Struct matrix_sdk::oidc::OidcAuthCodeUrlBuilder
source · pub struct OidcAuthCodeUrlBuilder { /* private fields */ }
experimental-oidc
only.Expand description
Builder type used to configure optional settings for authorization with an OpenID Connect Provider via the Authorization Code flow.
Created with Oidc::authorize_scope()
or Oidc::login()
. Finalized
with Self::build()
.
Implementations§
source§impl OidcAuthCodeUrlBuilder
impl OidcAuthCodeUrlBuilder
sourcepub fn display(self, display: Display) -> Self
pub fn display(self, display: Display) -> Self
Set how the Authorization Server should display the authentication and consent user interface pages to the End-User.
sourcepub fn prompt(self, prompt: Vec<Prompt>) -> Self
pub fn prompt(self, prompt: Vec<Prompt>) -> Self
Set the Prompt
of the authorization URL.
Prompt::Create
can be used to signify that the user wants to
register a new account. If Prompt::None
is used, it must be the only
value.
sourcepub fn max_age(self, max_age: NonZeroU32) -> Self
pub fn max_age(self, max_age: NonZeroU32) -> Self
Set the allowable elapsed time in seconds since the last time the End-User was actively authenticated by the OpenID Provider.
sourcepub fn ui_locales(self, ui_locales: Vec<LanguageTag>) -> Self
pub fn ui_locales(self, ui_locales: Vec<LanguageTag>) -> Self
Set the preferred locales of the user.
Must be ordered from the preferred locale to the least preferred locale.
sourcepub fn login_hint(self, login_hint: String) -> Self
pub fn login_hint(self, login_hint: String) -> Self
Set the hint to the Authorization Server about the login identifier the End-User might use to log in.
To set a Matrix user ID as a login hint, use Self::user_id_hint()
.
Erases any value set with 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.
To set another type of identifier as a login hint, use
Self::login_hint()
.
Erases any value set with Self::login_hint()
.
sourcepub fn acr_values(self, acr_values: HashSet<String>) -> Self
pub fn acr_values(self, acr_values: HashSet<String>) -> Self
Set the requested Authentication Context Class Reference values.
This is only necessary with specific providers.
sourcepub async fn build(self) -> Result<OidcAuthorizationData, OidcError>
pub async fn build(self) -> Result<OidcAuthorizationData, OidcError>
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 authorization can be completed by calling
Oidc::finish_authorization()
.
Returns an error if the client registration was not restored, or if a request fails.
Auto Trait Implementations§
impl Freeze for OidcAuthCodeUrlBuilder
impl !RefUnwindSafe for OidcAuthCodeUrlBuilder
impl Send for OidcAuthCodeUrlBuilder
impl Sync for OidcAuthCodeUrlBuilder
impl Unpin for OidcAuthCodeUrlBuilder
impl !UnwindSafe for OidcAuthCodeUrlBuilder
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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