pub struct AuthplaneAuth { /* private fields */ }Implementations§
Source§impl AuthplaneAuth
impl AuthplaneAuth
pub fn new( metadata: AuthorizationServerMetadata, fetch_settings: FetchSettings, http: Client, ) -> Self
pub fn metadata(&self) -> &AuthorizationServerMetadata
Sourcepub async fn client_credentials(
&self,
client_id: &str,
client_secret: &str,
scopes: &[String],
resources: &[String],
dpop: Option<&DpopProvider>,
) -> Result<TokenResponse, AuthplaneError>
pub async fn client_credentials( &self, client_id: &str, client_secret: &str, scopes: &[String], resources: &[String], dpop: Option<&DpopProvider>, ) -> Result<TokenResponse, AuthplaneError>
client_credentials grant (RFC 6749 §4.4). Pass Some(&provider)
to attach a DPoP-bound exchange; None for the plain bearer path.
The provider owns the per-origin nonce store, so the RFC 9449 §6.1
use_dpop_nonce retry is transparent across calls.
Sourcepub async fn client_credentials_with_header(
&self,
auth_header: &str,
scopes: &[String],
resources: &[String],
dpop: Option<&DpopProvider>,
) -> Result<TokenResponse, AuthplaneError>
pub async fn client_credentials_with_header( &self, auth_header: &str, scopes: &[String], resources: &[String], dpop: Option<&DpopProvider>, ) -> Result<TokenResponse, AuthplaneError>
client_credentials grant using a pre-built Authorization header
value (e.g. from an AuthProvider).
Pass Some(&provider) to attach a DPoP-bound exchange; None otherwise.
Sourcepub async fn exchange_token(
&self,
client_id: &str,
client_secret: &str,
options: &TokenExchangeOptions,
dpop: Option<&DpopProvider>,
) -> Result<TokenResponse, AuthplaneError>
pub async fn exchange_token( &self, client_id: &str, client_secret: &str, options: &TokenExchangeOptions, dpop: Option<&DpopProvider>, ) -> Result<TokenResponse, AuthplaneError>
RFC 8693 token exchange. Pass Some(&provider) to attach a DPoP-bound
exchange at the token endpoint; None for the plain bearer path.
Sourcepub async fn introspect(
&self,
client_id: &str,
client_secret: &str,
token: &str,
dpop: Option<&DpopProvider>,
) -> Result<IntrospectionResponse, AuthplaneError>
pub async fn introspect( &self, client_id: &str, client_secret: &str, token: &str, dpop: Option<&DpopProvider>, ) -> Result<IntrospectionResponse, AuthplaneError>
RFC 7662 token introspection. Pass Some(&provider) to attach a
DPoP-bound exchange at the introspection endpoint; None otherwise.
Sourcepub async fn revoke(
&self,
client_id: &str,
client_secret: &str,
token: &str,
dpop: Option<&DpopProvider>,
) -> Result<(), AuthplaneError>
pub async fn revoke( &self, client_id: &str, client_secret: &str, token: &str, dpop: Option<&DpopProvider>, ) -> Result<(), AuthplaneError>
RFC 7009 token revocation. Pass Some(&provider) to attach a DPoP-bound
exchange at the revocation endpoint; None otherwise.