Table of Contents

Class WebAuthentication

Namespace
The.Web.Security
Assembly
Instagile.Web.Client.dll

Produces identities based on an MVC HttpContext or a Blazor AuthenticationStateProvider.

public class WebAuthentication : IAuthentication
Inheritance
WebAuthentication
Implements
Inherited Members

Remarks

Note that the identity in an HC or an ASP may have been put there by the framework earlier!

Constructors

WebAuthentication(IClaimsPrincipalAccessor, bool)

Produces identities based on an MVC HttpContext or a Blazor AuthenticationStateProvider.

public WebAuthentication(IClaimsPrincipalAccessor accessor, bool allowAnonymous)

Parameters

accessor IClaimsPrincipalAccessor
allowAnonymous bool

Remarks

Note that the identity in an HC or an ASP may have been put there by the framework earlier!

Fields

REALM_KEY

public const string REALM_KEY = "http"

Field Value

string

Properties

IsAuthoritative

If true, the returned identity should be accepted without server verification

public bool IsAuthoritative { get; }

Property Value

bool

Remarks

May depend on ambient state - don't cache the result. As well as enabling automatic login, this is used by SecurityService to decide whether it's ok to perform purely-local authentication without calling IEntityStore.Connect.

Realm

Describes identities within the purview of this authenticator

public string Realm { get; }

Property Value

string

RequiresCredentials

Expects non-empty Credentials in order to perform client-side identity operations

public bool RequiresCredentials { get; }

Property Value

bool

Methods

GetIdentity(Credentials?)

Extract a subject from the environment or the supplied credentials.

public AuthenticationResult<string> GetIdentity(Credentials? credentials)

Parameters

credentials Credentials

Returns

AuthenticationResult<string>

subject name, unverified - from local knowledge only

VerifyIdentity(Credentials?, string)

Verify that the subject matches the supplied credentials. Available synchronously only if IsAuthoritative returns true.

public AuthenticationResult VerifyIdentity(Credentials? credentials, string subject)

Parameters

credentials Credentials
subject string

Returns

AuthenticationResult

(true/false for authentication state, null/reason for failure)

VerifyIdentityAsync(Credentials?, IEntityContext, string)

verify that the subject matches the supplied credentials

public Task<AuthenticationResult> VerifyIdentityAsync(Credentials? credentials, IEntityContext context, string subject)

Parameters

credentials Credentials
context IEntityContext
subject string

Returns

Task<AuthenticationResult>

(true/false for authentication state, null/reason for failure)