pub trait TokenIntrospectionResponse<TT>:
Debug
+ DeserializeOwned
+ Serializewhere
TT: TokenType,{
// Required methods
fn active(&self) -> bool;
fn scopes(&self) -> Option<&Vec<Scope>>;
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>>;
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§
Sourcefn active(&self) -> bool
fn active(&self) -> bool
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).
Sourcefn scopes(&self) -> Option<&Vec<Scope>>
fn scopes(&self) -> Option<&Vec<Scope>>
OPTIONAL. A JSON string containing a space-separated list of
scopes associated with this token, in the format described in
Section 3.3 of RFC 7662.
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
.
Sourcefn client_id(&self) -> Option<&ClientId>
fn client_id(&self) -> Option<&ClientId>
OPTIONAL. Client identifier for the OAuth 2.0 client that requested this token.
Sourcefn username(&self) -> Option<&str>
fn username(&self) -> Option<&str>
OPTIONAL. Human-readable identifier for the resource owner who authorized this token.
Sourcefn token_type(&self) -> Option<&TT>
fn token_type(&self) -> Option<&TT>
OPTIONAL. Type of the token as defined in
Section 5.1 of RFC 7662.
Value is case insensitive and deserialized to the generic TokenType
parameter.
Sourcefn exp(&self) -> Option<DateTime<Utc>>
fn exp(&self) -> Option<DateTime<Utc>>
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.
Sourcefn iat(&self) -> Option<DateTime<Utc>>
fn iat(&self) -> Option<DateTime<Utc>>
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.
Sourcefn nbf(&self) -> Option<DateTime<Utc>>
fn nbf(&self) -> Option<DateTime<Utc>>
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.
Sourcefn sub(&self) -> Option<&str>
fn sub(&self) -> Option<&str>
OPTIONAL. Subject of the token, as defined in JWT RFC7519. Usually a machine-readable identifier of the resource owner who authorized this token.
Sourcefn aud(&self) -> Option<&Vec<String>>
fn aud(&self) -> Option<&Vec<String>>
OPTIONAL. Service-specific string identifier or list of string identifiers representing the intended audience for this token, as defined in JWT RFC7519.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.