pub struct Provider { /* private fields */ }Expand description
Opaque provider — holds all the stores and dispatches requests.
Implementations§
Source§impl Provider
impl Provider
Sourcepub fn new(
config: ProviderConfig,
client_store: ClientStore,
session_store: SessionStore,
user_store: Arc<dyn UserStore>,
jwks: Jwks,
) -> Self
pub fn new( config: ProviderConfig, client_store: ClientStore, session_store: SessionStore, user_store: Arc<dyn UserStore>, jwks: Jwks, ) -> Self
Construct a provider.
Sourcepub fn config(&self) -> &ProviderConfig
pub fn config(&self) -> &ProviderConfig
Access the configuration.
Sourcepub fn client_store(&self) -> &ClientStore
pub fn client_store(&self) -> &ClientStore
Access the client store (for dynamic client registration endpoint).
Sourcepub fn session_store(&self) -> &SessionStore
pub fn session_store(&self) -> &SessionStore
Access the session store (for credentials-flow, logout, etc).
Sourcepub fn user_store_trait_object(&self) -> &dyn UserStore
pub fn user_store_trait_object(&self) -> &dyn UserStore
Access the underlying UserStore through a trait object.
Used by the optional axum binder to share one user store
across the /credentials handler and the /auth handler.
Sourcepub fn discovery_document(&self) -> DiscoveryDocument
pub fn discovery_document(&self) -> DiscoveryDocument
Render the discovery document for the configured issuer.
Start the authorization-code flow.
Returns AuthorizeResponse::Redirect on success (a code
has been minted and the client should receive a 302 to
redirect_uri?code=<code>&state=<state>), or
AuthorizeResponse::NeedsLogin when there is no active
session for the current request.
Sourcepub async fn token(
&self,
req: TokenRequest<'_>,
) -> Result<TokenResponse, ProviderError>
pub async fn token( &self, req: TokenRequest<'_>, ) -> Result<TokenResponse, ProviderError>
Exchange an authorization code at /token.
Requires a valid DPoP proof whose htu / htm match
POST {issuer}/idp/token. The returned access token is
bound to the proof’s JWK thumbprint (cnf.jkt).