Class CredentialResultExtension
- Namespace
- Arc4u.OAuth2.Extensions
- Assembly
- Arc4u.OAuth2.AspNetCore.dll
Extension methods to extract credentials from a Basic authentication payload.
public static class CredentialResultExtension
- Inheritance
-
CredentialResultExtension
- Inherited Members
Methods
ExtractCredential<T>(CredentialsResult, string, ILogger<T>, string?)
Splits a user:password pair. When the user name is not in a recognized format (user@domain.tld, DOMAIN\user or domain/user),
defaultUpn is appended to it.
public static CredentialsResult ExtractCredential<T>(this CredentialsResult credentials, string pair, ILogger<T> logger, string? defaultUpn = null)
Parameters
credentialsCredentialsResultThe credentials instance the method extends. It is not used.
pairstringThe decoded
user:passwordpair.loggerILogger<T>The logger.
defaultUpnstringThe domain suffix (for example
@contoso.com) appended to a user name without domain.
Returns
- CredentialsResult
The credentials found, or a CredentialsResult with CredentialsEntered set to false when
pairhas no:separator.
Type Parameters
TThe type of the category of the logger.