pub enum AssertionKeys {
ClientSecret {
secret: ClientSecretKey,
},
PublicKeys {
keys: Vec<PublicJwk>,
},
}client-assertion only.Expand description
What a registration expects a client assertion to be signed with.
The variants are the two RFC 7523 methods, and the choice between them is the choice of
algorithm: there is deliberately no way to spell “this client uses private_key_jwt and also
HS256”. See verify_assertion.
Variants§
ClientSecret
client_secret_jwt (RFC 7523 section 2.2 with a MAC): HMAC-SHA-256 under the registered
client secret.
Weaker than AssertionKeys::PublicKeys and supported because deployments have it: the
server still holds a secret that could authenticate as the client, so a dump of the client
table is still a set of working credentials. What it does buy over client_secret_basic is
that the secret never crosses the network, so it cannot be captured in transit or logged by
an intermediary.
Fields
secret: ClientSecretKeyThe shared secret. Held in the clear because HMAC verification needs the key itself; a
one-way crate::client::SecretHash cannot be used here, and pretending otherwise
would be the kind of storage that looks safe and is not.
A ClientSecretKey rather than a String so that the entropy floor cannot be walked
past by writing the variant out by hand.
PublicKeys
private_key_jwt (RFC 7523 section 2.2 with a digital signature): ECDSA P-256 under a key
only the client holds. This is the variant to reach for.
Implementations§
Source§impl AssertionKeys
impl AssertionKeys
Sourcepub fn token_endpoint_auth_method(&self) -> &'static str
pub fn token_endpoint_auth_method(&self) -> &'static str
The RFC 8414 method name this registration authenticates with.
Sourcepub fn signing_alg(&self) -> &'static str
pub fn signing_alg(&self) -> &'static str
The ONE alg this registration’s assertions may carry.
Singular on purpose. A registration that accepted a SET of algorithms would be one where an attacker gets to pick from that set, and the interesting attacks are all about picking the element the deployment did not think about.
Trait Implementations§
Source§impl Clone for AssertionKeys
impl Clone for AssertionKeys
Source§fn clone(&self) -> AssertionKeys
fn clone(&self) -> AssertionKeys
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AssertionKeys
Hand-written for the same reason as crate::client::ClientAuth’s: ClientAuth derives
nothing that would print a secret, and this type sits inside it. The PUBLIC keys stay visible,
because they are public and because “which keys does this registration actually hold” is the
first question anyone debugging a private_key_jwt failure asks.
impl Debug for AssertionKeys
Hand-written for the same reason as crate::client::ClientAuth’s: ClientAuth derives
nothing that would print a secret, and this type sits inside it. The PUBLIC keys stay visible,
because they are public and because “which keys does this registration actually hold” is the
first question anyone debugging a private_key_jwt failure asks.