oauth2::basic

Type Alias BasicTokenIntrospectionResponse

Source
pub type BasicTokenIntrospectionResponse = StandardTokenIntrospectionResponse<EmptyExtraTokenFields, BasicTokenType>;
Expand description

Basic OAuth2 token introspection response.

Aliased Type§

struct BasicTokenIntrospectionResponse { /* private fields */ }

Implementations

Source§

impl<EF, TT> StandardTokenIntrospectionResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType,

Source

pub fn new(active: bool, extra_fields: EF) -> Self

Instantiate a new OAuth2 token introspection response.

Source

pub fn set_active(&mut self, active: bool)

Sets the set_active field.

Source

pub fn set_scopes(&mut self, scopes: Option<Vec<Scope>>)

Sets the set_scopes field.

Source

pub fn set_client_id(&mut self, client_id: Option<ClientId>)

Sets the set_client_id field.

Source

pub fn set_username(&mut self, username: Option<String>)

Sets the set_username field.

Source

pub fn set_token_type(&mut self, token_type: Option<TT>)

Sets the set_token_type field.

Source

pub fn set_exp(&mut self, exp: Option<DateTime<Utc>>)

Sets the set_exp field.

Source

pub fn set_iat(&mut self, iat: Option<DateTime<Utc>>)

Sets the set_iat field.

Source

pub fn set_nbf(&mut self, nbf: Option<DateTime<Utc>>)

Sets the set_nbf field.

Source

pub fn set_sub(&mut self, sub: Option<String>)

Sets the set_sub field.

Source

pub fn set_aud(&mut self, aud: Option<Vec<String>>)

Sets the set_aud field.

Source

pub fn set_iss(&mut self, iss: Option<String>)

Sets the set_iss field.

Source

pub fn set_jti(&mut self, jti: Option<String>)

Sets the set_jti field.

Source

pub fn extra_fields(&self) -> &EF

Extra fields defined by the client application.

Source

pub fn set_extra_fields(&mut self, extra_fields: EF)

Sets the set_extra_fields field.

Trait Implementations

Source§

impl<EF, TT> Clone for StandardTokenIntrospectionResponse<EF, TT>
where EF: ExtraTokenFields + Clone, TT: TokenType + 'static + Clone,

Source§

fn clone(&self) -> StandardTokenIntrospectionResponse<EF, TT>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<EF, TT> Debug for StandardTokenIntrospectionResponse<EF, TT>
where EF: ExtraTokenFields + Debug, TT: TokenType + 'static + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, EF, TT> Deserialize<'de> for StandardTokenIntrospectionResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType + 'static,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<EF, TT> Serialize for StandardTokenIntrospectionResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType + 'static,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<EF, TT> TokenIntrospectionResponse<TT> for StandardTokenIntrospectionResponse<EF, TT>
where EF: ExtraTokenFields, TT: TokenType,

Source§

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

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.
Source§

fn client_id(&self) -> Option<&ClientId>

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

fn username(&self) -> Option<&str>

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

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

fn iss(&self) -> Option<&str>

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

fn jti(&self) -> Option<&str>

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