#[non_exhaustive]pub struct TokenResponse {
pub access_token: String,
pub token_type: String,
pub expires_in: Option<u64>,
pub refresh_token: Option<String>,
pub id_token: Option<String>,
pub scope: Option<String>,
}Expand description
Re-export of the OAuth2 token-endpoint wire DTO (RFC 6749 §5.1 + OIDC Core §3.1.3.3). Token response from PAS token endpoint.
id_token is OIDC-only (RFC 6749 token responses carry only
access + refresh; OIDC Core §3.1.3.3 adds id_token when scope
includes openid). crate::oidc::RelyingParty<S> reads it
internally and converts to crate::oidc::RefreshOutcome /
crate::oidc::Completion at the SDK boundary.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.access_token: String§token_type: String§expires_in: Option<u64>§refresh_token: Option<String>§id_token: Option<String>§scope: Option<String>The scope actually granted, space-delimited (RFC 6749 §5.1).
Optional by specification, and absence is meaningful rather than
missing data: the field may be omitted precisely when the granted
scope is identical to the requested one. None therefore means
“granted as requested” and must be treated as success — see
crate::scope_grant::ensure_covers, the one place that reads it.
(Today’s PAS always echoes, but this SDK is published and must speak the RFC rather than the behavior of one server.)
Trait Implementations§
Source§impl Clone for TokenResponse
impl Clone for TokenResponse
Source§fn clone(&self) -> TokenResponse
fn clone(&self) -> TokenResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more