pub struct ExternalLoginsLinkResource<'a> { /* private fields */ }Expand description
client.external_logins().link()
Implementations§
Source§impl<'a> ExternalLoginsLinkResource<'a>
impl<'a> ExternalLoginsLinkResource<'a>
Sourcepub fn create(
&self,
external_login_id: impl Display,
body: &ExternalLoginLinkCreate,
) -> Result<ExternalLoginLinkResult>
pub fn create( &self, external_login_id: impl Display, body: &ExternalLoginLinkCreate, ) -> Result<ExternalLoginLinkResult>
Verify and link an external identity
POST /externallogins/{externalLoginId}/link
Completes the verified_user_linking flow after a successful external identity-provider callback requested proof of a ChurchTools account. Requires the same browser session and pending linkToken, a visible provider in verified_user_linking mode, and valid credentials for an active, non-archived person. Tokens expire after 600 seconds; only ten pending links are retained per session. Each attempt clears any previous pending two-factor session. If the account uses two-factor authentication, no identity is linked yet: data.location points to the two-factor screen and POST /login/totp completes linking after verification. Otherwise the external identity is linked and the ChurchTools session is logged in. Navigate to data.location; this endpoint returns JSON rather than an HTTP redirect. The token is consumed after successful login. Credential failures can increment the account’s failed-login counter; the shared login rate limit also applies.
§Example
let body = models::ExternalLoginLinkCreate {
link_token: "opaque-session-bound-link-token".into(),
password: "geheim".into(),
username: "alex@example.org".into(),
..Default::default()
};
let result = client.external_logins().link().create(7, &body)?;
println!("{}", result.location);Sourcepub fn create_person(
&self,
external_login_id: impl Display,
body: &ExternalLoginPersonCreate,
) -> Result<ExternalLoginLinkResult>
pub fn create_person( &self, external_login_id: impl Display, body: &ExternalLoginPersonCreate, ) -> Result<ExternalLoginLinkResult>
Create a person for an external identity
POST /externallogins/{externalLoginId}/link/create-person
Creates a ChurchTools person from a pending verified external identity, links it and establishes the ChurchTools login session. Requires the same browser session and unexpired linkToken, a visible provider in verified_user_linking mode and createNewPerson enabled. Tokens expire after 600 seconds and are consumed after successful login. The external identity must not already be mapped. Person name, email and username come from the saved provider identity; department, campus and status come from the provider configuration. A nonblank last name is required by person creation. Returns JSON data.location for the client to navigate to. Person creation/mapping commit before session login, so a later completion error does not guarantee that no person was created.
§Example
let body = models::ExternalLoginPersonCreate {
link_token: "opaque-session-bound-link-token".into(),
..Default::default()
};
let result = client.external_logins().link().create_person(7, &body)?;
println!("{}", result.location);