Class AuthenticationHeaderParser
Parsed authentication headers to retrieve header values from HttpResponseHeaders.
public class AuthenticationHeaderParser
- Inheritance
-
AuthenticationHeaderParser
- Inherited Members
Constructors
AuthenticationHeaderParser()
public AuthenticationHeaderParser()
Properties
AuthenticationInfoParameters
Parameters returned by the Authentication-Info
header.
This allows for more complex authentication scenarios, such as Proof-Of-Possession.
public AuthenticationInfoParameters AuthenticationInfoParameters { get; }
Property Value
PopNonce
Nonce parsed from HttpResponseHeaders. This is acquired from the Proof-of-Possession WWW-Authenticate
header or the Authentication-Info
header
public string PopNonce { get; }
Property Value
WwwAuthenticateParameters
Parameters returned by the WWW-Authenticate
header. This allows for dynamic
scenarios such as Claims challenge, Continuous Access Evaluation (CAE), and Conditional Access auth context.
See our documentation for additional details.
public IReadOnlyList<WwwAuthenticateParameters> WwwAuthenticateParameters { get; }
Property Value
Methods
ParseAuthenticationHeaders(HttpResponseHeaders)
Creates a parsed set of parameters from the provided HttpResponseHeaders.
public static AuthenticationHeaderParser ParseAuthenticationHeaders(HttpResponseHeaders httpResponseHeaders)
Parameters
httpResponseHeaders
HttpResponseHeadersHTTP response headers.
Returns
- AuthenticationHeaderParser
An instance of AuthenticationHeaderParser.
Remarks
For known values, such as the nonce used for Proof-of-Possession, the parser will first check for it in the WWW-Authenticate
headers
If it cannot find it, it will then check the Authentication-Info
parameters for the value.
ParseAuthenticationHeadersAsync(string, HttpClient, CancellationToken)
Creates the authentication parameters by attempting to call the resource unauthenticated and analyzing the response.
public static Task<AuthenticationHeaderParser> ParseAuthenticationHeadersAsync(string resourceUri, HttpClient httpClient, CancellationToken cancellationToken = default)
Parameters
resourceUri
stringResource URI.
httpClient
HttpClientInstance of HttpClient to make the request with.
cancellationToken
CancellationTokenCancellation token to cancel the operation.
Returns
- Task<AuthenticationHeaderParser>
An instance of AuthenticationHeaderParser containing authentication header data.
Exceptions
- ArgumentNullException
Thrown if the
resourceUri
orhttpClient
is null.
ParseAuthenticationHeadersAsync(string, CancellationToken)
Creates the authentication parameters by attempting to call the resource unauthenticated and analyzing the response.
public static Task<AuthenticationHeaderParser> ParseAuthenticationHeadersAsync(string resourceUri, CancellationToken cancellationToken = default)
Parameters
resourceUri
stringResource URI.
cancellationToken
CancellationTokenCancellation token to cancel the operation.
Returns
- Task<AuthenticationHeaderParser>
An instance of AuthenticationHeaderParser containing authentication header data.