pub struct CodeTokenRequest<'a, TE, TR, TT>
where TE: ErrorResponse, TR: TokenResponse<TT>, TT: TokenType,
{ /* private fields */ }
Expand description

A request to exchange an authorization code for an access token.

See https://tools.ietf.org/html/rfc6749#section-4.1.3.

Implementations§

source§

impl<'a, TE, TR, TT> CodeTokenRequest<'a, TE, TR, TT>
where TE: ErrorResponse + 'static, TR: TokenResponse<TT>, TT: TokenType,

source

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

Appends an extra param to the token request.

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_verifier( self, pkce_verifier: PkceCodeVerifier ) -> CodeTokenRequest<'a, TE, TR, TT>

Completes the Proof Key for Code Exchange (PKCE) protocol flow.

This method must be called if set_pkce_challenge was used during the authorization request.

source

pub fn set_redirect_uri( self, redirect_url: Cow<'a, RedirectUrl> ) -> CodeTokenRequest<'a, TE, TR, TT>

Overrides the redirect_url to the one specified.

source

pub fn request<F, RE>( self, http_client: F ) -> Result<TR, RequestTokenError<RE, TE>>
where F: FnOnce(HttpRequest) -> Result<HttpResponse, RE>, RE: Error + 'static,

Synchronously sends the request to the authorization server and awaits a response.

source

pub async fn request_async<C, F, RE>( self, http_client: C ) -> Result<TR, RequestTokenError<RE, TE>>
where C: FnOnce(HttpRequest) -> F, F: Future<Output = Result<HttpResponse, RE>>, RE: Error + 'static,

Asynchronously sends the request to the authorization server and returns a Future.

Trait Implementations§

source§

impl<'a, TE, TR, TT> Debug for CodeTokenRequest<'a, TE, TR, TT>
where TE: Debug + ErrorResponse, TR: Debug + TokenResponse<TT>, TT: Debug + TokenType,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, TE, TR, TT> RefUnwindSafe for CodeTokenRequest<'a, TE, TR, TT>

§

impl<'a, TE, TR, TT> Send for CodeTokenRequest<'a, TE, TR, TT>
where TE: Send, TR: Send, TT: Send,

§

impl<'a, TE, TR, TT> Sync for CodeTokenRequest<'a, TE, TR, TT>
where TE: Sync, TR: Sync, TT: Sync,

§

impl<'a, TE, TR, TT> Unpin for CodeTokenRequest<'a, TE, TR, TT>
where TE: Unpin, TR: Unpin, TT: Unpin,

§

impl<'a, TE, TR, TT> UnwindSafe for CodeTokenRequest<'a, TE, TR, TT>
where TE: UnwindSafe, TR: UnwindSafe, TT: 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