pub struct OidcClient { /* private fields */ }Expand description
The sign-in side for apps that render pages on a server (e.g. an Axum theme): the Authorization Code flow with PKCE and a nonce.
authorize_urlgives the provider URL to redirect the browser to, and aPendingSignInto keep (for example in a short-lived HttpOnly cookie).- On the redirect back,
exchangechecks the state, swaps the code for tokens and verifies the ID token (signature, issuer, audience, nonce). Send that ID token to the MCP backend as the bearer.
Implementations§
Source§impl OidcClient
impl OidcClient
Sourcepub async fn discover(
issuer: &str,
client_id: &str,
client_secret: Option<&str>,
) -> Result<Self>
pub async fn discover( issuer: &str, client_id: &str, client_secret: Option<&str>, ) -> Result<Self>
Discovers the provider for the app registered as client_id
(client_secret for confidential clients, None for public ones).
The provider URL to send the browser to, and what to remember until it
comes back to redirect_url (registered at the provider).
Trait Implementations§
Source§impl Clone for OidcClient
impl Clone for OidcClient
Auto Trait Implementations§
impl !RefUnwindSafe for OidcClient
impl !UnwindSafe for OidcClient
impl Freeze for OidcClient
impl Send for OidcClient
impl Sync for OidcClient
impl Unpin for OidcClient
impl UnsafeUnpin for OidcClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more