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>>,
}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.
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.
Trait Implementations§
Source§impl Clone for AuthorizationRequestData
impl Clone for AuthorizationRequestData
Source§fn clone(&self) -> AuthorizationRequestData
fn clone(&self) -> AuthorizationRequestData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more