Struct openidconnect::CodeTokenRequest [−][src]
pub struct CodeTokenRequest<'a, TE, TR, TT> where
TE: ErrorResponse,
TR: TokenResponse<TT>,
TT: TokenType, { /* fields omitted */ }
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
impl<'a, TE, TR, TT> CodeTokenRequest<'a, TE, TR, TT> where
TE: 'static + ErrorResponse,
TR: TokenResponse<TT>,
TT: TokenType,
impl<'a, TE, TR, TT> CodeTokenRequest<'a, TE, TR, TT> where
TE: 'static + ErrorResponse,
TR: TokenResponse<TT>,
TT: TokenType,
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>>,
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.
pub fn set_pkce_verifier(
self,
pkce_verifier: PkceCodeVerifier
) -> CodeTokenRequest<'a, TE, TR, TT>
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.
pub fn set_redirect_uri(
self,
redirect_url: Cow<'a, RedirectUrl>
) -> CodeTokenRequest<'a, TE, TR, TT>
pub fn set_redirect_uri(
self,
redirect_url: Cow<'a, RedirectUrl>
) -> CodeTokenRequest<'a, TE, TR, TT>
Overrides the redirect_url
to the one specified.
pub fn request<F, RE>(
self,
http_client: F
) -> Result<TR, RequestTokenError<RE, TE>> where
F: FnOnce(HttpRequest) -> Result<HttpResponse, RE>,
RE: 'static + Error,
pub fn request<F, RE>(
self,
http_client: F
) -> Result<TR, RequestTokenError<RE, TE>> where
F: FnOnce(HttpRequest) -> Result<HttpResponse, RE>,
RE: 'static + Error,
Synchronously sends the request to the authorization server and awaits a response.
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: 'static + Error,
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: 'static + Error,
Asynchronously sends the request to the authorization server and returns a Future.