Trait phabricator_oauth::TokenResponse[][src]

pub trait TokenResponse<TT>: Debug + DeserializeOwned + Serialize where
    TT: TokenType
{ pub fn access_token(&self) -> &AccessToken;
pub fn token_type(&self) -> &TT;
pub fn expires_in(&self) -> Option<Duration>;
pub fn refresh_token(&self) -> Option<&RefreshToken>;
pub fn scopes(&self) -> Option<&Vec<Scope, Global>>; }

Common methods shared by all OAuth2 token implementations.

The methods in this trait are defined in Section 5.1 of RFC 6749. This trait exists separately from the StandardTokenResponse struct to support customization by clients, such as supporting interoperability with non-standards-complaint OAuth2 providers.

Required methods

pub fn access_token(&self) -> &AccessToken[src]

REQUIRED. The access token issued by the authorization server.

pub fn token_type(&self) -> &TT[src]

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

pub fn expires_in(&self) -> Option<Duration>[src]

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.

pub fn refresh_token(&self) -> Option<&RefreshToken>[src]

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

pub fn scopes(&self) -> Option<&Vec<Scope, Global>>[src]

OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED. The scipe 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.

Loading content...

Implementations on Foreign Types

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

pub fn access_token(&self) -> &AccessToken[src]

REQUIRED. The access token issued by the authorization server.

pub fn token_type(&self) -> &TT[src]

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

pub fn expires_in(&self) -> Option<Duration>[src]

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.

pub fn refresh_token(&self) -> Option<&RefreshToken>[src]

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

pub fn scopes(&self) -> Option<&Vec<Scope, Global>>[src]

OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED. The scipe 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.

Loading content...

Implementors

Loading content...