pub struct AuthorizationRequest<'a, AD, P, RT>
where AD: AuthDisplay, P: AuthPrompt, RT: ResponseType,
{ /* private fields */ }
Expand description

A request to the authorization endpoint.

Implementations§

source§

impl<'a, AD, P, RT> AuthorizationRequest<'a, AD, P, RT>
where AD: AuthDisplay, P: AuthPrompt, RT: ResponseType,

source

pub fn add_scope(self, scope: Scope) -> Self

Appends a new scope to the authorization URL.

source

pub fn add_scopes<I>(self, scopes: I) -> Self
where I: IntoIterator<Item = Scope>,

Appends a collection of scopes to the authorization URL.

source

pub fn add_extra_param<N, V>(self, name: N, value: V) -> Self
where N: Into<Cow<'a, str>>, V: Into<Cow<'a, str>>,

Appends an extra param to the authorization URL.

This method allows extensions to be used without direct support from this crate. If name conflicts with a parameter managed by this crate, the behavior is undefined. In particular, do not set parameters defined by RFC 6749 or RFC 7636.

§Security Warning

Callers should follow the security recommendations for any OAuth2 extensions used with this function, which are beyond the scope of RFC 6749.

source

pub fn set_pkce_challenge(self, pkce_code_challenge: PkceCodeChallenge) -> Self

Enables the use of Proof Key for Code Exchange (PKCE).

PKCE is highly recommended for all public clients (i.e., those for which there is no client secret or for which the client secret is distributed with the client, such as in a native, mobile app, or browser app).

source

pub fn add_auth_context_value( self, acr_value: AuthenticationContextClass ) -> Self

Requests Authentication Context Class Reference values.

ACR values should be added in order of preference. The Authentication Context Class satisfied by the authentication performed is accessible from the ID token via the IdTokenClaims::auth_context_ref method.

source

pub fn add_claims_locale(self, claims_locale: LanguageTag) -> Self

Requests the preferred languages for claims returned by the OpenID Connect Provider.

Languages should be added in order of preference.

source

pub fn set_display(self, display: AD) -> Self

Specifies how the OpenID Connect Provider displays the authentication and consent user interfaces to the end user.

source

pub fn set_id_token_hint<AC, GC, JE, JS, JT>( self, id_token_hint: &'a IdToken<AC, GC, JE, JS, JT> ) -> Self

Provides an ID token previously issued by this OpenID Connect Provider as a hint about the user’s identity.

This field should be set whenever core::CoreAuthPrompt::None is used (see AuthorizationRequest::add_prompt), it but may be provided for any authorization request.

source

pub fn set_login_hint(self, login_hint: LoginHint) -> Self

Provides the OpenID Connect Provider with a hint about the user’s identity.

The nature of this hint is specific to each provider.

source

pub fn set_max_age(self, max_age: Duration) -> Self

Sets a maximum amount of time since the user has last authenticated with the OpenID Connect Provider.

If more time has elapsed, the provider forces the user to re-authenticate.

source

pub fn add_prompt(self, prompt: P) -> Self

Specifies what level of authentication and consent prompts the OpenID Connect Provider should present to the user.

source

pub fn add_ui_locale(self, ui_locale: LanguageTag) -> Self

Requests the preferred languages for the user interface presented by the OpenID Connect Provider.

Languages should be added in order of preference.

source

pub fn set_redirect_uri(self, redirect_url: Cow<'a, RedirectUrl>) -> Self

Overrides the redirect_url to the one specified.

source

pub fn url(self) -> (Url, CsrfToken, Nonce)

Returns the full authorization URL and CSRF state for this authorization request.

Auto Trait Implementations§

§

impl<'a, AD, P, RT> RefUnwindSafe for AuthorizationRequest<'a, AD, P, RT>

§

impl<'a, AD, P, RT> Send for AuthorizationRequest<'a, AD, P, RT>
where AD: Send, P: Send, RT: Send,

§

impl<'a, AD, P, RT> Sync for AuthorizationRequest<'a, AD, P, RT>
where AD: Sync, P: Sync, RT: Sync,

§

impl<'a, AD, P, RT> Unpin for AuthorizationRequest<'a, AD, P, RT>
where AD: Unpin, P: Unpin, RT: Unpin,

§

impl<'a, AD, P, RT> UnwindSafe for AuthorizationRequest<'a, AD, P, RT>
where AD: UnwindSafe, P: UnwindSafe, RT: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more