pub struct AuthorizationRequestData {
pub client_id: String,
pub scope: Scope,
pub redirect_uri: Url,
pub code_challenge_methods_supported: Option<Vec<PkceCodeChallengeMethod>>,
pub display: Option<Display>,
pub prompt: Option<Vec<Prompt>>,
pub max_age: Option<NonZeroU32>,
pub ui_locales: Option<Vec<LanguageTag>>,
pub id_token_hint: Option<String>,
pub login_hint: Option<String>,
pub acr_values: Option<HashSet<String>>,
pub response_mode: Option<ResponseMode>,
}Expand description
The data necessary to build an authorization request.
Fields§
§client_id: StringThe ID obtained when registering the client.
scope: ScopeThe scope to authorize.
If the OpenID Connect scope token (openid) is not included, it will be
added.
redirect_uri: UrlThe URI to redirect the end-user to after the authorization.
It must be one of the redirect URIs provided during registration.
code_challenge_methods_supported: Option<Vec<PkceCodeChallengeMethod>>The PKCE methods supported by the issuer.
This field should be cloned from the provider metadata. If it is not set, this security measure will not be used.
display: Option<Display>How the Authorization Server should display the authentication and consent user interface pages to the End-User.
prompt: Option<Vec<Prompt>>Whether the Authorization Server should prompt the End-User for reauthentication and consent.
If Prompt::None is used, it must be the only value.
max_age: Option<NonZeroU32>The allowable elapsed time in seconds since the last time the End-User was actively authenticated by the OpenID Provider.
ui_locales: Option<Vec<LanguageTag>>End-User’s preferred languages and scripts for the user interface.
id_token_hint: Option<String>ID Token previously issued by the Authorization Server being passed as a hint about the End-User’s current or past authenticated session with the Client.
login_hint: Option<String>Hint to the Authorization Server about the login identifier the End-User might use to log in.
acr_values: Option<HashSet<String>>Requested Authentication Context Class Reference values.
response_mode: Option<ResponseMode>Requested response mode.
Implementations§
Source§impl AuthorizationRequestData
impl AuthorizationRequestData
Sourcepub fn new(client_id: String, scope: Scope, redirect_uri: Url) -> Self
pub fn new(client_id: String, scope: Scope, redirect_uri: Url) -> Self
Constructs a new AuthorizationRequestData with all the required
fields.
Sourcepub fn with_code_challenge_methods_supported(
self,
code_challenge_methods_supported: Vec<PkceCodeChallengeMethod>,
) -> Self
pub fn with_code_challenge_methods_supported( self, code_challenge_methods_supported: Vec<PkceCodeChallengeMethod>, ) -> Self
Set the code_challenge_methods_supported field of this
AuthorizationRequestData.
Sourcepub fn with_display(self, display: Display) -> Self
pub fn with_display(self, display: Display) -> Self
Set the display field of this AuthorizationRequestData.
Sourcepub fn with_prompt(self, prompt: Vec<Prompt>) -> Self
pub fn with_prompt(self, prompt: Vec<Prompt>) -> Self
Set the prompt field of this AuthorizationRequestData.
Sourcepub fn with_max_age(self, max_age: NonZeroU32) -> Self
pub fn with_max_age(self, max_age: NonZeroU32) -> Self
Set the max_age field of this AuthorizationRequestData.
Sourcepub fn with_ui_locales(self, ui_locales: Vec<LanguageTag>) -> Self
pub fn with_ui_locales(self, ui_locales: Vec<LanguageTag>) -> Self
Set the ui_locales field of this AuthorizationRequestData.
Sourcepub fn with_id_token_hint(self, id_token_hint: String) -> Self
pub fn with_id_token_hint(self, id_token_hint: String) -> Self
Set the id_token_hint field of this AuthorizationRequestData.
Sourcepub fn with_login_hint(self, login_hint: String) -> Self
pub fn with_login_hint(self, login_hint: String) -> Self
Set the login_hint field of this AuthorizationRequestData.
Sourcepub fn with_acr_values(self, acr_values: HashSet<String>) -> Self
pub fn with_acr_values(self, acr_values: HashSet<String>) -> Self
Set the acr_values field of this AuthorizationRequestData.
Sourcepub fn with_response_mode(self, response_mode: ResponseMode) -> Self
pub fn with_response_mode(self, response_mode: ResponseMode) -> Self
Set the response_mode field of this AuthorizationRequestData.
Trait Implementations§
Source§impl Clone for AuthorizationRequestData
impl Clone for AuthorizationRequestData
Source§fn clone(&self) -> AuthorizationRequestData
fn clone(&self) -> AuthorizationRequestData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AuthorizationRequestData
impl RefUnwindSafe for AuthorizationRequestData
impl Send for AuthorizationRequestData
impl Sync for AuthorizationRequestData
impl Unpin for AuthorizationRequestData
impl UnwindSafe for AuthorizationRequestData
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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