Table of Contents

Class IdentityServerUser

Namespace
Fdyay.IdentityServer
Assembly
Fdyay.IdentityServer.Core.dll

A user being signed in to this server's session, as a login page describes them.

public class IdentityServerUser
Inheritance
IdentityServerUser
Inherited Members

Remarks

Duende 8.0.1's, measured, for a host's own login page: await HttpContext.SignInAsync(new IdentityServerUser(sub)) signs it in to the session's scheme. CreatePrincipal() is the principal that becomes.

Constructors

IdentityServerUser(string)

Creates a user with the given subject identifier, which becomes the sub claim.

public IdentityServerUser(string subjectId)

Parameters

subjectId string

The user's subject identifier. Must not be null, empty or whitespace.

Exceptions

ArgumentException

subjectId is null, empty or whitespace.

Properties

AdditionalClaims

Any other claims the session should carry.

public ICollection<Claim> AdditionalClaims { get; set; }

Property Value

ICollection<Claim>

AuthenticationMethods

The amr claims: how the user authenticated.

public ICollection<string> AuthenticationMethods { get; set; }

Property Value

ICollection<string>

AuthenticationTime

The auth_time claim. The time of the sign-in when not set.

public DateTime? AuthenticationTime { get; set; }

Property Value

DateTime?

DisplayName

The name claim, when there is one.

public string? DisplayName { get; set; }

Property Value

string

IdentityProvider

The idp claim: which provider the user signed in with. local when not set.

public string? IdentityProvider { get; set; }

Property Value

string

SubjectId

The user's subject identifier, the sub claim. Required.

public string SubjectId { get; }

Property Value

string

Tenant

The tenant claim, when there is one.

public string? Tenant { get; set; }

Property Value

string

Methods

CreatePrincipal()

The principal this user signs in as.

public ClaimsPrincipal CreatePrincipal()

Returns

ClaimsPrincipal

Remarks

Duende's claims in Duende's order — sub, name, idp, tenant, auth_time, one amr per method, then the additional claims — with duplicates removed, in one identity whose name and role claims are name and role. Its authentication type is this server's name where Duende's is its own.