Struct matrix_sdk::matrix_auth::SsoLoginBuilder

source ·
pub struct SsoLoginBuilder<F> { /* private fields */ }
Available on crate feature sso-login only.
Expand description

Builder type used to configure optional settings for logging in via SSO.

Created with MatrixAuth::login_sso. Finalized with .send().

Implementations§

source§

impl<F, Fut> SsoLoginBuilder<F>
where F: FnOnce(String) -> Fut + Send, Fut: Future<Output = Result<()>> + Send,

source

pub fn device_id(self, value: &str) -> Self

Set the device ID.

The device ID is a unique ID that will be associated with this session. If not set, the homeserver will create one. Can be an existing device ID from a previous login call. Note that this should be done only if the client also holds the corresponding encryption keys.

source

pub fn initial_device_display_name(self, value: &str) -> Self

Set the initial device display name.

The device display name is the public name that will be associated with the device ID. Only necessary the first time you login with this device ID. It can be changed later.

source

pub fn server_url(self, value: &str) -> Self

Set the local URL the server is going to try to bind to.

Usually something like http://localhost:3030. If not set, the server will try to open a random port on 127.0.0.1.

source

pub fn server_response(self, value: &str) -> Self

Set the text to be shown at the end of the login process.

This configures the text that will be shown on the webpage at the end of the login process. This can be an HTML page. If not set, a default text will be displayed.

source

pub fn identity_provider_id(self, value: &str) -> Self

Set the ID of the identity provider to log in with.

source

pub fn request_refresh_token(self) -> Self

Advertise support for refreshing access tokens.

By default, the Client won’t handle refreshing access tokens, so Client::refresh_access_token() or MatrixAuth::refresh_access_token() needs to be called manually.

This behavior can be changed by calling handle_refresh_tokens() when building the Client.

Note that refreshing access tokens might not be supported or might be enforced by the homeserver regardless of this setting.

source

pub async fn send(self) -> Result<Response>

Send the login request.

Instead of calling this function and .awaiting its return value, you can also .await the SsoLoginBuilder directly.

§Panics

Panics if a session was already restored or logged in.

Trait Implementations§

source§

impl<F, Fut> IntoFuture for SsoLoginBuilder<F>
where F: FnOnce(String) -> Fut + Send + 'static, Fut: Future<Output = Result<()>> + Send + 'static,

§

type Output = Result<Response, Error>

The output that the future will produce on completion.
§

type IntoFuture = Pin<Box<dyn Future<Output = <SsoLoginBuilder<F> as IntoFuture>::Output> + Send>>

Which kind of future are we turning this into?
source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

§

impl<F> Freeze for SsoLoginBuilder<F>
where F: Freeze,

§

impl<F> !RefUnwindSafe for SsoLoginBuilder<F>

§

impl<F> Send for SsoLoginBuilder<F>
where F: Send,

§

impl<F> Sync for SsoLoginBuilder<F>
where F: Sync,

§

impl<F> Unpin for SsoLoginBuilder<F>
where F: Unpin,

§

impl<F> !UnwindSafe for SsoLoginBuilder<F>

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
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
source§

fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
source§

fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<>
source§

fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

source§

const WITNESS: W = W::MAKE

A constant of the type witness
source§

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

§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> Any for T
where T: Any,

source§

impl<T> SendOutsideWasm for T
where T: Send,

source§

impl<T> SyncOutsideWasm for T
where T: Sync,