Table of Contents

Class AuthChallenge

Namespace
Trellis
Assembly
Trellis.Core.dll

Represents a single HTTP authentication challenge (RFC 9110 §11.6.1) carried by Error.Unauthorized. Multiple challenges may be combined to round-trip the full WWW-Authenticate header.

public sealed record AuthChallenge : IEquatable<AuthChallenge>
Inheritance
AuthChallenge
Implements
Inherited Members
Extension Methods

Constructors

AuthChallenge(string, ImmutableDictionary<string, string>?)

Represents a single HTTP authentication challenge (RFC 9110 §11.6.1) carried by Error.Unauthorized. Multiple challenges may be combined to round-trip the full WWW-Authenticate header.

public AuthChallenge(string Scheme, ImmutableDictionary<string, string>? Params = null)

Parameters

Scheme string

The auth scheme (e.g. "Bearer", "Basic").

Params ImmutableDictionary<string, string>

Optional parameters for the challenge (e.g. realm, scope, error). Compared by value contents; parameter order is not significant.

Properties

Params

Optional parameters for the challenge (e.g. realm, scope, error). Compared by value contents; parameter order is not significant.

public ImmutableDictionary<string, string>? Params { get; init; }

Property Value

ImmutableDictionary<string, string>

Scheme

The auth scheme (e.g. "Bearer", "Basic").

public string Scheme { get; init; }

Property Value

string

Methods

Equals(AuthChallenge?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(AuthChallenge? other)

Parameters

other AuthChallenge

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.