Method TryReadKeyId
- Namespace
- MailFathom.Infrastructure.Security.OAuth
- Assembly
- MailFathom.Infrastructure.dll
TryReadKeyId(string?, out string?)
Reads the key identifier a compact-serialized JSON Web Token names for the key that signed it.
public static bool TryReadKeyId(string? credential, out string? keyId)
Parameters
credentialstringThe bearer credential a request presented.
keyIdstringThe unverified
kidheader when the credential is a JSON Web Token carrying one; otherwise null.
Returns
Remarks
What it decides is which stored public key the signature is checked against, and no more. The key it names is verified against afterwards, so a credential writing whatever it likes here picks which key refuses it — and one naming a key this deployment holds for another user is refused by that key's own signature check rather than admitted as that user.