Expand description
Confidential clients: private_key_jwt client authentication.
A confidential client names private_key_jwt as its
token_endpoint_auth_method and publishes its public keys in its client
metadata, as jwks or behind jwks_uri. Every request it makes to
POST /oauth/par and POST /oauth/token carries a client_assertion: a
JWT it signs with one of those keys (RFC 7523 §2.2). A public client
(none) sends none, and a request from one that carries one is refused.
A confidential client’s login is bound to the key its assertion at PAR was
signed with (ClientAuthKey), as the atproto profile’s “Confidential
Client Authentication” requires. The code, and every refresh after it, is
refused unless the request is signed with that same key, found in the key
set the client publishes now; see crate::oauth::token.
An assertion is single-use. Its jti is held for as long as the assertion
could still be accepted, in a window bounded the way the DPoP proof window
is (crate::replay).
Structs§
- Assertion
Claims 🔒 - The claims this module reads itself.
jsonwebtokenchecksiss,sub,aud,expandnbf. - Authenticated
Client - A confidential client that authenticated a request, and the key it signed with.
- Client
Assertion Verifier - Checks client assertions, and holds the
jtiof each one it accepts until the assertion could no longer be accepted anyway. - Client
Authentication - How a client authenticates: the client authentication half of its
metadata document, flattened into
ClientMetadataDocument. - Client
Credentials - The client authentication a request carries: RFC 7521 §4.2’s two parameters, as they arrived.
- Jwks
- A confidential client’s key set, as this server reads it: the keys it can check an assertion against.
Enums§
- Client
Auth Error - Why a client did not authenticate.
Constants§
- ALGORITHM 🔒
SIGNING_ALG, asjsonwebtokennames it.- ASSERTION_
CLOCK_ SKEW - How far a client’s clock may sit from this server’s, either way, when an
assertion’s
iat,expandnbfare read. - ASSERTION_
MAX_ AGE - How old an assertion may be, by its
iat, before it has expired.ASSERTION_CLOCK_SKEWis allowed on top. - ASSERTION_
TYPE - The
client_assertion_typea confidential client sends (RFC 7523 §2.2). - NONE
- The
token_endpoint_auth_methodof a public client. - PRIVATE_
KEY_ JWT - The
token_endpoint_auth_methodof a confidential client. - SIGNING_
ALG - The algorithm a confidential client signs its assertions with. The atproto profile requires every client and server to support ES256, and this server verifies nothing else.
Functions§
- invalid 🔒
- An
ClientAuthError::Invalidsayingwhat. - refusal 🔒
- What a failed signature or claim check says, in this server’s words.
- replay_
key 🔒 - Where a spent
jtiis held: a digest of the client and thejtitogether, so two clients’jtis never collide and a longclient_idcosts the window no more than a short one. - usable 🔒
published, if it is a key an assertion can be checked against.- window 🔒
- The longest an assertion is accepted for after its
iat, clock skew included, and so how long itsjtiis held.