oauth2::basic

Type Alias BasicTokenResponse

Source
pub type BasicTokenResponse = StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>;
Expand description

Basic OAuth2 token response.

Aliased Type§

struct BasicTokenResponse { /* private fields */ }

Implementations

Source§

impl<EF, TT> StandardTokenResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType,

Source

pub fn new(access_token: AccessToken, token_type: TT, extra_fields: EF) -> Self

Instantiate a new OAuth2 token response.

Source

pub fn set_access_token(&mut self, access_token: AccessToken)

Set the access_token field.

Source

pub fn set_token_type(&mut self, token_type: TT)

Set the token_type field.

Source

pub fn set_expires_in(&mut self, expires_in: Option<&Duration>)

Set the expires_in field.

Source

pub fn set_refresh_token(&mut self, refresh_token: Option<RefreshToken>)

Set the refresh_token field.

Source

pub fn set_scopes(&mut self, scopes: Option<Vec<Scope>>)

Set the scopes field.

Source

pub fn extra_fields(&self) -> &EF

Extra fields defined by the client application.

Source

pub fn set_extra_fields(&mut self, extra_fields: EF)

Set the extra fields defined by the client application.

Trait Implementations

Source§

impl<EF, TT> Clone for StandardTokenResponse<EF, TT>

Source§

fn clone(&self) -> StandardTokenResponse<EF, TT>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<EF, TT> Debug for StandardTokenResponse<EF, TT>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de, EF, TT> Deserialize<'de> for StandardTokenResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<EF, TT> Serialize for StandardTokenResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<EF, TT> TokenResponse<TT> for StandardTokenResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType,

Source§

fn access_token(&self) -> &AccessToken

REQUIRED. The access token issued by the authorization server.

Source§

fn token_type(&self) -> &TT

REQUIRED. The type of the token issued as described in Section 7.1. Value is case insensitive and deserialized to the generic TokenType parameter.

Source§

fn expires_in(&self) -> Option<Duration>

RECOMMENDED. The lifetime in seconds of the access token. For example, the value 3600 denotes that the access token will expire in one hour from the time the response was generated. If omitted, the authorization server SHOULD provide the expiration time via other means or document the default value.

Source§

fn refresh_token(&self) -> Option<&RefreshToken>

OPTIONAL. The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in Section 6.

Source§

fn scopes(&self) -> Option<&Vec<Scope>>

OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED. The scope of the access token as described by Section 3.3. If included in the response, this space-delimited field is parsed into a Vec of individual scopes. If omitted from the response, this field is None.