[][src]Trait oauth2::TokenInspectionResponse

pub trait TokenInspectionResponse<TT>: Debug + DeserializeOwned + Serialize where
    TT: TokenType
{ pub fn active(&self) -> bool;
pub fn scopes(&self) -> Option<&Vec<Scope>>;
pub fn client_id(&self) -> Option<&ClientId>;
pub fn username(&self) -> Option<&str>;
pub fn token_type(&self) -> Option<&TT>;
pub fn exp(&self) -> Option<DateTime<Utc>>;
pub fn iat(&self) -> Option<DateTime<Utc>>;
pub fn nbf(&self) -> Option<DateTime<Utc>>;
pub fn sub(&self) -> Option<&str>;
pub fn aud(&self) -> Option<&Vec<String>>;
pub fn iss(&self) -> Option<&str>;
pub fn jti(&self) -> Option<&str>; }

Common methods shared by all OAuth2 token inspection implementations.

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

Required methods

pub fn active(&self) -> bool[src]

REQUIRED. Boolean indicator of whether or not the presented token is currently active. The specifics of a token's "active" state will vary depending on the implementation of the authorization server and the information it keeps about its tokens, but a "true" value return for the "active" property will generally indicate that a given token has been issued by this authorization server, has not been revoked by the resource owner, and is within its given time window of validity (e.g., after its issuance time and before its expiration time).

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

OPTIONAL. A JSON string containing a space-separated list of scopes associated with this token, in the format described in Section 3.3 of OAuth 2.0. 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.

pub fn client_id(&self) -> Option<&ClientId>[src]

OPTIONAL. Client identifier for the OAuth 2.0 client that requested this token.

pub fn username(&self) -> Option<&str>[src]

OPTIONAL. Human-readable identifier for the resource owner who authorized this token.

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

OPTIONAL. Type of the token as defined in Section 5.1 of OAuth 2.0 [RFC6749]. Value is case insensitive and deserialized to the generic TokenType parameter.

pub fn exp(&self) -> Option<DateTime<Utc>>[src]

OPTIONAL. Integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire, as defined in JWT RFC7519.

pub fn iat(&self) -> Option<DateTime<Utc>>[src]

OPTIONAL. Integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token was originally issued, as defined in JWT RFC7519.

pub fn nbf(&self) -> Option<DateTime<Utc>>[src]

OPTIONAL. Integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token is not to be used before, as defined in JWT RFC7519.

pub fn sub(&self) -> Option<&str>[src]

OPTIONAL. Subject of the token, as defined in JWT RFC7519. Usually a machine-readable identifier of the resource owner who authorized this token.

pub fn aud(&self) -> Option<&Vec<String>>[src]

OPTIONAL. Service-specific string identifier or list of string identifiers representing the intended audience for this token, as defined in JWT RFC7519.

pub fn iss(&self) -> Option<&str>[src]

OPTIONAL. String representing the issuer of this token, as defined in JWT RFC7519.

pub fn jti(&self) -> Option<&str>[src]

OPTIONAL. String identifier for the token, as defined in JWT RFC7519.

Loading content...

Implementors

impl<EF, TT> TokenInspectionResponse<TT> for StandardTokenInspectionResponse<EF, TT> where
    EF: ExtraTokenFields,
    TT: TokenType
[src]

Loading content...