pub struct OAuthAuthCodeUrlBuilder { /* private fields */ }
Expand description
Builder type used to configure optional settings for authorization with an OAuth 2.0 authorization server via the Authorization Code flow.
Created with OAuth::login()
. Finalized with Self::build()
.
Implementations§
Source§impl OAuthAuthCodeUrlBuilder
impl OAuthAuthCodeUrlBuilder
Sourcepub fn prompt(self, prompt: Vec<Prompt>) -> Self
pub fn prompt(self, prompt: Vec<Prompt>) -> Self
Set the Prompt
of the authorization URL.
If this is not set, it is assumed that the user wants to log into an existing account.
Prompt::Create
can be used to signify that the user wants to
register a new account.
Sourcepub fn login_hint(self, login_hint: String) -> Self
pub fn login_hint(self, login_hint: String) -> Self
Set a generic login hint to help an identity provider pre-fill the login form.
Note: This is not the same as the Self::user_id_hint()
method, which
is specifically designed to a) take a UserId
and no other type of
hint and b) be used directly by MAS and not the identity provider.
The most likely use case for this method is to pre-fill the login page
using a provisioning link provided by an external party such as
https://app.example.com/?server_name=example.org&login_hint=alice
In this instance it is up to the external party to make ensure that the
hint is known to work with their identity provider. For more information
see login_hint
in https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
The following methods are mutually exclusive: Self::login_hint()
and
Self::user_id_hint()
.
Sourcepub fn user_id_hint(self, user_id: &UserId) -> Self
pub fn user_id_hint(self, user_id: &UserId) -> Self
Set the hint to the Authorization Server about the Matrix user ID the End-User might use to log in, as defined in MSC4198.
The following methods are mutually exclusive: Self::login_hint()
and
Self::user_id_hint()
.
Sourcepub async fn build(self) -> Result<OAuthAuthorizationData, OAuthError>
pub async fn build(self) -> Result<OAuthAuthorizationData, OAuthError>
Get the URL that should be presented to login via the Authorization Code flow.
This URL should be presented to the user and once they are redirected to
the redirect_uri
, the login can be completed by calling
OAuth::finish_login()
.
Returns an error if the client registration was not restored, or if a request fails.
Auto Trait Implementations§
impl Freeze for OAuthAuthCodeUrlBuilder
impl !RefUnwindSafe for OAuthAuthCodeUrlBuilder
impl Send for OAuthAuthCodeUrlBuilder
impl Sync for OAuthAuthCodeUrlBuilder
impl Unpin for OAuthAuthCodeUrlBuilder
impl !UnwindSafe for OAuthAuthCodeUrlBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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