Skip to main content

UserInfoHandler Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Endpoints.UserInfo

UserInfoHandler Class

Handles user information requests in an OpenID Connect compliant manner. It ensures that requests for user info are correctly validated and processed, returning the requested user information if the request is authorized.

public class UserInfoHandler : Abblix.Oidc.Server.Endpoints.UserInfo.Interfaces.IUserInfoHandler

Inheritance System.Object → UserInfoHandler

Implements IUserInfoHandler

Constructors

UserInfoHandler(IUserInfoRequestValidator, IUserInfoRequestProcessor) Constructor

Handles user information requests in an OpenID Connect compliant manner. It ensures that requests for user info are correctly validated and processed, returning the requested user information if the request is authorized.

public UserInfoHandler(Abblix.Oidc.Server.Endpoints.UserInfo.Interfaces.IUserInfoRequestValidator validator, Abblix.Oidc.Server.Endpoints.UserInfo.Interfaces.IUserInfoRequestProcessor processor);

Parameters

validator IUserInfoRequestValidator

An implementation of IUserInfoRequestValidator responsible for validating user info requests against OpenID Connect specifications.

processor IUserInfoRequestProcessor

An implementation of IUserInfoRequestProcessor responsible for processing validated requests and retrieving user information.

Methods

UserInfoHandler.HandleAsync(UserInfoRequest, ClientRequest) Method

Asynchronously processes a user info request by first validating it and then, if validation is successful, retrieving the requested user information.

public System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.UserInfo.Interfaces.UserInfoFoundResponse,Abblix.Oidc.Server.Common.OidcError>> HandleAsync(Abblix.Oidc.Server.Model.UserInfoRequest userInfoRequest, Abblix.Oidc.Server.Model.ClientRequest clientRequest);

Parameters

userInfoRequest UserInfoRequest

The user info request containing necessary parameters such as the access token.

clientRequest ClientRequest

Additional information about the client making the request, useful for contextual validation.

Implements HandleAsync(UserInfoRequest, ClientRequest)

Returns

System.Threading.Tasks.Task<Abblix.Utils.Result<UserInfoFoundResponse,OidcError>>
A System.Threading.Tasks.Task that resolves to a UserInfoFoundResponse, which contains the requested user information in case of a valid request, or an OidcError detailing the reason for failure.

Remarks

This method is pivotal for ensuring that only authenticated and authorized requests gain access to sensitive user information, in line with OpenID Connect protocols. It leverages the validator to ensure requests meet OIDC standards and the processor to fetch and return the relevant user information securely.