pub struct PendingAuthorization { /* private fields */ }Expand description
Everything a client must keep between sending the user away and handling the callback.
§Redaction
Debug renders the secrets as … and the rest normally. The verifier and
the state are both load-bearing — one redeems the code, the other proves
the callback belongs to this request — and this is the value a client holds
in memory across a user-visible redirect.
Implementations§
Source§impl PendingAuthorization
impl PendingAuthorization
Sourcepub const fn state(&self) -> &State
pub const fn state(&self) -> &State
The state this request issued, for comparing against the callback.
Sourcepub const fn code_verifier(&self) -> &CodeVerifier
pub const fn code_verifier(&self) -> &CodeVerifier
The PKCE verifier to present when redeeming the code.
Sourcepub const fn resource(&self) -> &ResourceBinding
pub const fn resource(&self) -> &ResourceBinding
What the grant is bound to, and what the token request must repeat.
Sourcepub fn redirect_uri(&self) -> &str
pub fn redirect_uri(&self) -> &str
The redirect URI the authorization request named.
Sourcepub const fn client_id(&self) -> &ClientId
pub const fn client_id(&self) -> &ClientId
The client this request was made as.
The token request has to name the same client, so a caller resuming the flow after the redirect needs it back from here rather than keeping a second copy alongside the pending value.
Sourcepub fn issuer(&self) -> &str
pub fn issuer(&self) -> &str
The issuer this flow is with.
Carried so the redemption step can check an iss response against
something the client recorded when it started, rather than against a
value read from the response it is trying to validate.
Sourcepub fn with_scope(self, scope: impl AsRef<str>) -> Self
pub fn with_scope(self, scope: impl AsRef<str>) -> Self
This request, asking for scope (space-separated).
Omitted when not set: the authorization page has the client omit
scope entirely when neither the challenge nor scopes_supported
names any.
Sourcepub const fn with_iss_advertised(self, advertised: bool) -> Self
pub const fn with_iss_advertised(self, advertised: bool) -> Self
This request, recording that the server advertised iss support, so a
response without one is refused.
Sourcepub const fn iss_advertised(&self) -> bool
pub const fn iss_advertised(&self) -> bool
Whether the server advertised iss support.
Render the URL to send the user to.
Appends to whatever query the endpoint already carries, because the endpoint came from a discovery document this crate does not control.
§Errors
BeginError::Endpoint when the authorization endpoint is not a URL
this crate can append to.