Method TryRead
- Namespace
- MailFathom.Infrastructure.Security.OAuth
- Assembly
- MailFathom.Infrastructure.dll
TryRead(string?, out string)
Reads the credential an Authorization header value carried.
public static bool TryRead(string? authorizationHeaderValue, out string credential)
Parameters
authorizationHeaderValuestringThe raw header value, or null when the request carried none.
credentialstringThe credential when the header carried one; otherwise an empty string.
Returns
Remarks
The scheme is matched ignoring case, as HTTP requires, and at least one space separates it from the credential. Anything else — another scheme, a scheme with no credential, a bare token — is malformed rather than a credential worth judging, and the caller refuses it with the same response as every other rejection.