Skip to main content

AuthorizationResponse

Struct AuthorizationResponse 

Source
pub struct AuthorizationResponse {
    pub code: String,
    pub state: Option<String>,
    pub iss: String,
}
Expand description

The success redirect parameters (RFC 6749 section 4.1.2).

Debug is HAND-WRITTEN (above) and does not print the code. The RECORD form of the same value, AuthorizationCodeRecord, has been hand-redacted since it was written, for the reason stated there – RFC 6749 section 4.1.2 makes a code a credential in its own right – and this type, which carries the same string to the client, was left deriving until 0.9.2. A host that logs the response it is about to redirect with would have written a live, unredeemed code into its logs; PKCE binds the code to a DIFFERENT client, not to a reader who has the log and the verifier, and for a confidential client it does not bind at all.

Fields§

§code: String

The single-use authorization code.

§state: Option<String>

The request’s state, echoed verbatim; REQUIRED iff the request carried one.

§iss: String

RFC 9207 section 2: this server’s issuer identifier, so a client talking to several authorization servers can tell WHICH one answered.

Not an Option: this server always supports RFC 9207 and its metadata says so (authorization_response_iss_parameter_supported), and section 2 makes the parameter mandatory for a server that does. A response that could omit it would be a response a client cannot rely on, which defeats the mix-up countermeasure RFC 9700 section 4.4 is asking for.

Implementations§

Source§

impl AuthorizationResponse

Source

pub fn location(&self, redirect_uri: &str) -> String

The Location header value for the success redirect.

Parameter ORDER is not constrained by any RFC (RFC 6749 section 4.1.2 and RFC 9207 section 2 both describe an unordered set of query parameters), so iss is appended last purely to keep the existing prefix of the URL unchanged.

Trait Implementations§

Source§

impl Clone for AuthorizationResponse

Source§

fn clone(&self) -> AuthorizationResponse

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AuthorizationResponse

Hand-written so the one-time code never prints. state and iss print in full: state is the client’s own opaque value echoed back and iss is this server’s public identifier.

Source§

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

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

impl<'de> Deserialize<'de> for AuthorizationResponse

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 Eq for AuthorizationResponse

Source§

impl PartialEq for AuthorizationResponse

Source§

fn eq(&self, other: &AuthorizationResponse) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AuthorizationResponse

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 StructuralPartialEq for AuthorizationResponse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.