Expand description
JWT/OIDC authentication for the Canton Ledger API.
Provides the OAuth2 client-credentials flow with a TokenProvider
that caches the access token and refreshes it before expiry. Secrets are
redacted from Debug output.
use canton_auth::{OidcConfig, TokenProvider};
let provider = TokenProvider::new(OidcConfig::new(
"http://localhost:8082/realms/AppProvider/protocol/openid-connect/token",
"app-provider-backend",
"…",
));
let bearer = provider.token().await?;Structs§
- Oidc
Config - OIDC client-credentials configuration for a token endpoint.
- Token
Provider - Fetches and caches an OAuth2 bearer token via the client-credentials grant, refreshing it shortly before expiry. Cloning shares the cache.
Enums§
- Client
Auth - How the client credentials are presented to the token endpoint.