pub struct AuthorizationCode {
pub code: String,
pub client_id: String,
pub redirect_uri: String,
pub scopes: Vec<String>,
pub code_challenge: String,
pub code_challenge_method: CodeChallengeMethod,
pub issued_at: Instant,
pub expires_at: Instant,
pub subject: Option<String>,
pub state: Option<String>,
}Expand description
Authorization code issued during the authorization flow.
Fields§
§code: StringThe code value.
client_id: StringClient ID this code was issued to.
redirect_uri: StringRedirect URI used in the authorization request.
scopes: Vec<String>Approved scopes.
code_challenge: StringPKCE code challenge.
code_challenge_method: CodeChallengeMethodPKCE code challenge method.
issued_at: InstantWhen the code was issued.
expires_at: InstantWhen the code expires.
subject: Option<String>Subject (user) this code was issued for.
state: Option<String>State parameter from the authorization request.
Implementations§
Source§impl AuthorizationCode
impl AuthorizationCode
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Checks if this code has expired.
Sourcepub fn validate_code_verifier(&self, verifier: &str) -> bool
pub fn validate_code_verifier(&self, verifier: &str) -> bool
Validates the PKCE code verifier against the stored challenge.
Trait Implementations§
Source§impl Clone for AuthorizationCode
impl Clone for AuthorizationCode
Source§fn clone(&self) -> AuthorizationCode
fn clone(&self) -> AuthorizationCode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthorizationCode
impl RefUnwindSafe for AuthorizationCode
impl Send for AuthorizationCode
impl Sync for AuthorizationCode
impl Unpin for AuthorizationCode
impl UnwindSafe for AuthorizationCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).