Skip to main content

SamlResource

Struct SamlResource 

Source
pub struct SamlResource<'a> { /* private fields */ }
Expand description

client.saml()

Implementations§

Source§

impl<'a> SamlResource<'a>

Source

pub fn acs(&self) -> Result<Vec<u8>>

Consume a SAML authentication response

POST /saml/acs

Legacy SAML URL. Resolves the single configured SAML provider; with zero or multiple SAML providers it cannot resolve a provider. Prefer the provider-specific /externallogins/{externalLoginId}/saml/acs URL. Public assertion-consumer callback for the identity provider’s form POST. Validates the SAML response and maps the external identity to a ChurchTools person. Successful login redirects to the stored destination or the installation landing page; identities needing account linking are redirected into that flow instead. Normal login requires a visible provider. Administrator test flows can use hidden providers and return a small HTML page that closes the popup, without logging the tested identity in. Test failures can also return that 200 HTML page: read the separate test-result endpoint for the outcome. A pending administrator test with missing RelayState also returns the popup page. Normal failures return 401 as localized text or an HTML error page, never the usual JSON error envelope.

§Example
let data = client.saml().acs()?;
std::fs::write("ergebnis.bin", &data)?;
Source

pub fn get_login(&self) -> Result<()>

Start a SAML browser login

GET /saml/login

Legacy SAML URL. Resolves the single configured SAML provider; with zero or multiple SAML providers it cannot resolve a provider. Prefer the provider-specific /externallogins/{externalLoginId}/saml/login URL. Starts the browser-based SAML login for a visible SAML external-login provider. Redirects to the configured identity provider with a SAML authentication request and an opaque RelayState. An optional post-login redirect is saved in the browser session, so the callback must retain that session. Only absolute URLs on this installation’s origin and within its base path are accepted; invalid redirect values are ignored. Missing, hidden or invalid providers and other setup failures produce a localized 404 response. No login or JSON access token is returned by this endpoint itself.

Use Self::get_login_with to pass query parameters.

§Example
client.saml().get_login()?;
Source

pub fn get_login_with(&self, query: &GetSamlLoginQuery) -> Result<()>

Start a SAML browser login

Like Self::get_login, with query parameters.

GET /saml/login

Legacy SAML URL. Resolves the single configured SAML provider; with zero or multiple SAML providers it cannot resolve a provider. Prefer the provider-specific /externallogins/{externalLoginId}/saml/login URL. Starts the browser-based SAML login for a visible SAML external-login provider. Redirects to the configured identity provider with a SAML authentication request and an opaque RelayState. An optional post-login redirect is saved in the browser session, so the callback must retain that session. Only absolute URLs on this installation’s origin and within its base path are accepted; invalid redirect values are ignored. Missing, hidden or invalid providers and other setup failures produce a localized 404 response. No login or JSON access token is returned by this endpoint itself.

Source

pub fn get_metadata(&self) -> Result<Vec<u8>>

Get SAML service-provider metadata

GET /saml/metadata

Legacy SAML URL. Resolves the single configured SAML provider; with zero or multiple SAML providers it cannot resolve a provider. Prefer the provider-specific /externallogins/{externalLoginId}/saml/metadata URL. Returns the XML metadata that an identity-provider administrator uses to configure ChurchTools as a SAML service provider. The entity ID, assertion-consumer URL and logout URL refer to this external-login provider. This endpoint is public and also works for a hidden provider, allowing setup before enabling login. Any provider/configuration/metadata-generation failure is returned as 404 with localized text, not a JSON error envelope.

§Example
let data = client.saml().get_metadata()?;
std::fs::write("ergebnis.bin", &data)?;

Trait Implementations§

Source§

impl<'a> Clone for SamlResource<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for SamlResource<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for SamlResource<'a>

§

impl<'a> !UnwindSafe for SamlResource<'a>

§

impl<'a> Freeze for SamlResource<'a>

§

impl<'a> Send for SamlResource<'a>

§

impl<'a> Sync for SamlResource<'a>

§

impl<'a> Unpin for SamlResource<'a>

§

impl<'a> UnsafeUnpin for SamlResource<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more