Skip to main content

UserClaimsProvider Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.UserInfo

UserClaimsProvider Class

Handles the retrieval of user claims for authentication sessions, ensuring compliance with requested scopes and specific claim details. This class integrates directly with user information providers and scope-to-claim mappings to fetch and validate the necessary user data. It supports converting user data into claims that adhere to OpenID Connect standards, tailored to the specific needs of the client making the request.

public class UserClaimsProvider : Abblix.Oidc.Server.Features.UserInfo.IUserClaimsProvider

Inheritance System.Object → UserClaimsProvider

Implements IUserClaimsProvider

Constructors

UserClaimsProvider(ILogger<UserClaimsProvider>, IUserInfoProvider, IScopeClaimsProvider, ISubjectTypeConverter) Constructor

Handles the retrieval of user claims for authentication sessions, ensuring compliance with requested scopes and specific claim details. This class integrates directly with user information providers and scope-to-claim mappings to fetch and validate the necessary user data. It supports converting user data into claims that adhere to OpenID Connect standards, tailored to the specific needs of the client making the request.

public UserClaimsProvider(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Features.UserInfo.UserClaimsProvider> logger, Abblix.Oidc.Server.Features.UserInfo.IUserInfoProvider userInfoProvider, Abblix.Oidc.Server.Features.UserInfo.IScopeClaimsProvider scopeClaimsProvider, Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter subjectTypeConverter);

Parameters

logger Microsoft.Extensions.Logging.ILogger<UserClaimsProvider>

The logger used for logging information and errors.

userInfoProvider IUserInfoProvider

The provider used to retrieve detailed user information based on specific claims.

scopeClaimsProvider IScopeClaimsProvider

The provider that maps requested scopes to the corresponding set of claims.

subjectTypeConverter ISubjectTypeConverter

The converter used to translate user identifiers into subject types as required by different client configurations.

Methods

UserClaimsProvider.GetUserClaimsAsync(AuthSession, ICollection<string>, ICollection<KeyValuePair<string,RequestedClaimDetails>>, ClientInfo) Method

Asynchronously retrieves structured user claims based on an authentication session and specific claim parameters. This method ensures compliance with the OpenID Connect standards by validating essential claims and formatting the user data into a structured JSON object.

public System.Threading.Tasks.Task<System.Text.Json.Nodes.JsonObject?> GetUserClaimsAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession authSession, System.Collections.Generic.ICollection<string> scope, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,Abblix.Oidc.Server.Model.RequestedClaimDetails>>? requestedClaims, Abblix.Oidc.Server.Features.ClientInformation.ClientInfo clientInfo);

Parameters

authSession AuthSession

The authentication session providing the context for user claims retrieval.

scope System.Collections.Generic.ICollection<System.String>

A collection of scopes defining the categories of claims required.

requestedClaims System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,RequestedClaimDetails>>

A collection detailing specific claims requested by the client, including any requirements for essential claims.

clientInfo ClientInfo

Information about the client application making the request, which may influence how claims are processed and returned.

Implements GetUserClaimsAsync(AuthSession, ICollection<string>, ICollection<KeyValuePair<string,RequestedClaimDetails>>, ClientInfo)

Returns

System.Threading.Tasks.Task<System.Text.Json.Nodes.JsonObject>
A task that when completed returns a System.Text.Json.Nodes.JsonObject representing the user claims, or throws an exception if required claims are missing.