Table of Contents

Class UserObjectIdentifier

Namespace
Arc4u.OAuth2.Security
Assembly
Arc4u.OAuth2.AspNetCore.dll

Default IUserObjectIdentifier: the identifier is the value of the first claim whose type is one of the configured ClaimsIdentifierOption claim types (by default the object identifier claims).

[Export(typeof(IUserObjectIdentifier))]
[Shared]
public class UserObjectIdentifier : IUserObjectIdentifier
Inheritance
UserObjectIdentifier
Implements
Inherited Members

Constructors

UserObjectIdentifier(IOptions<ClaimsIdentifierOption>, ILogger<UserObjectIdentifier>)

Initializes a new instance of the UserObjectIdentifier class.

public UserObjectIdentifier(IOptions<ClaimsIdentifierOption> identifierOptions, ILogger<UserObjectIdentifier> logger)

Parameters

identifierOptions IOptions<ClaimsIdentifierOption>

The claim types that identify a user.

logger ILogger<UserObjectIdentifier>

The logger.

Methods

Getidentifier(ClaimsIdentity)

Gets the identifier of the user.

public string? Getidentifier(ClaimsIdentity identity)

Parameters

identity ClaimsIdentity

The identity of the user.

Returns

string

The value of the first claim whose type is configured to identify a user, or null when there is none.