Skip to main content

Crate canton_auth

Crate canton_auth 

Source
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§

OidcConfig
OIDC client-credentials configuration for a token endpoint.
TokenProvider
Fetches and caches an OAuth2 bearer token via the client-credentials grant, refreshing it shortly before expiry. Cloning shares the cache.

Enums§

ClientAuth
How the client credentials are presented to the token endpoint.