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 !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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§fn clone_handle(handle: Handle) -> Handle
fn clone_handle(handle: Handle) -> Handle
§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>