Struct tokkit::TokenInfo[][src]

pub struct TokenInfo {
    pub active: bool,
    pub user_id: Option<UserId>,
    pub scope: Vec<Scope>,
    pub expires_in_seconds: Option<u64>,
}

Information on an AccessToken returned by a TokenInfoService.

See OAuth 2.0 Token Introspection

Fields

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). See Section 4 for information on implementation of such checks.

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

Remark: This is usually not a human readable id but a custom field since we are in the realm of S2S authorization.

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 RFC6749.

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.

Remark: Contains the number of seconds until the token expires. This seems to be used by most introspection services.

Methods

impl TokenInfo
[src]

Use for authorization. Checks whether this TokenInfo has the given Scope.

Use for authorization. Checks whether this TokenInfo has all of the given Scopes.

If the TokenInfo does not have the scope this method will fail.

Trait Implementations

impl Debug for TokenInfo
[src]

Formats the value using the given formatter. Read more

impl PartialEq for TokenInfo
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl Send for TokenInfo

impl Sync for TokenInfo