Skip to main content

Module client_assertion

Module client_assertion 

Source
Expand description

private_key_jwt client authentication (RFC 7523 section 2.2, OIDC Core section 9).

The client proves who it is with a JWT signed by a key whose public half it registered, instead of sending a shared secret. The service (services/client_assertion.rs) accepts it at the token endpoint and the pushed authorization endpoint only, and requires: RS256, PS256 or ES256; iss and sub both the client id; aud the URL of the endpoint it is presented to (or the issuer); an exp at most 300 seconds ahead; a jti it has not seen. An assertion is single use: create_client_assertion mints a new one, with a new random jti, per request.

Structs§

ClientAssertionKey
A private key registered for a client. The private half cannot be read back from this value, and it prints only the algorithm and the kid.
ClientAssertionOptions
Test hooks and the lifetime of one assertion.

Constants§

CLIENT_ASSERTION_TYPE
client_assertion_type for a JWT assertion (RFC 7523).
DEFAULT_CLIENT_ASSERTION_LIFETIME_SECONDS
Lifetime of an assertion when the caller does not say.
MAX_CLIENT_ASSERTION_LIFETIME_SECONDS
The service refuses an assertion whose exp is further than this ahead.

Functions§

create_client_assertion
A signed assertion for audience: <issuer>/oauth/token or <issuer>/oauth/par.
import_client_assertion_key
Load a private key for private_key_jwt: a private JWK or a PKCS#8 PEM.