pub struct CodeTokenRequest<'a, TE, TR, TT>{ /* private fields */ }
Expand description
A request to exchange an authorization code for an access token.
Implementations§
Source§impl<'a, TE, TR, TT> CodeTokenRequest<'a, TE, TR, TT>
impl<'a, TE, TR, TT> CodeTokenRequest<'a, TE, TR, TT>
Sourcepub fn add_extra_param<N, V>(self, name: N, value: V) -> Self
pub fn add_extra_param<N, V>(self, name: N, value: V) -> Self
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.
Sourcepub fn set_pkce_verifier(self, pkce_verifier: PkceCodeVerifier) -> Self
pub fn set_pkce_verifier(self, pkce_verifier: PkceCodeVerifier) -> Self
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.
Sourcepub fn set_redirect_uri(self, redirect_url: Cow<'a, RedirectUrl>) -> Self
pub fn set_redirect_uri(self, redirect_url: Cow<'a, RedirectUrl>) -> Self
Overrides the redirect_url
to the one specified.
Sourcepub fn request<F, RE>(
self,
http_client: F,
) -> Result<TR, RequestTokenError<RE, TE>>
pub fn request<F, RE>( self, http_client: F, ) -> Result<TR, RequestTokenError<RE, TE>>
Synchronously sends the request to the authorization server and awaits a response.
Sourcepub 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,
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.