Method TryReadClaimedIssuer
- Namespace
- MailFathom.Infrastructure.Security.OAuth
- Assembly
- MailFathom.Infrastructure.dll
TryReadClaimedIssuer(string?, out string?)
Reads the issuer a compact-serialized JSON Web Token claims.
public static bool TryReadClaimedIssuer(string? credential, out string? claimedIssuer)
Parameters
credentialstringThe bearer credential a request presented.
claimedIssuerstringThe unverified issuer when the credential is a JSON Web Token carrying one; otherwise null.
Returns
Remarks
A false result covers everything that is not a JSON Web Token naming an issuer: an opaque
credential such as an API key, a malformed token, a payload that is not JSON, and a token whose iss is
absent or is not a string. None of them is distinguished, because the caller does the same thing with all of them.
TryReadClaimedIssuer(ReadOnlySpan<char>, out string?)
Reads the issuer a compact-serialized JSON Web Token claims, from characters that are not a string.
public static bool TryReadClaimedIssuer(ReadOnlySpan<char> credential, out string? claimedIssuer)
Parameters
credentialReadOnlySpan<char>The credential characters, which the caller may be holding outside the managed heap.
claimedIssuerstringThe unverified issuer when the characters are a JSON Web Token carrying one; otherwise null.
Returns
Remarks
Startup asks this of revealed API key material, which is held in a pinned buffer that is cleared afterwards, so the question has to be answerable without copying that material into a string the collector would move and leave behind.