Trait openidconnect::TokenIntrospectionResponse[][src]

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

Common methods shared by all OAuth2 token introspection implementations.

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

Required methods

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

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.

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

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

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.

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.

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.

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.

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

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

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

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

Implementors