Table of Contents

Class UserInfoRequestValidator

Namespace
Fdyay.IdentityServer.Validation
Assembly
Fdyay.IdentityServer.AspNetCore.dll

Duende's default userinfo request validator.

public class UserInfoRequestValidator : IUserInfoRequestValidator
Inheritance
UserInfoRequestValidator
Implements
Inherited Members

Remarks

In the ASP.NET Core assembly rather than with its interface, because it reads the issuer off the request and the user off the server-side ticket store, both of which live here.

Constructors

UserInfoRequestValidator(ITokenValidator, IProfileService, IClientStore, IIssuerNameService, IHttpContextAccessor, IServerSideTicketStore?)

public UserInfoRequestValidator(ITokenValidator tokens, IProfileService profile, IClientStore clients, IIssuerNameService issuerNameService, IHttpContextAccessor httpContextAccessor, IServerSideTicketStore? tickets = null)

Parameters

tokens ITokenValidator

Validates the access token.

profile IProfileService

Asked whether the user is still active.

clients IClientStore

The client the token was issued to, which must still be served.

issuerNameService IIssuerNameService

This server's issuer, which the token is validated against.

httpContextAccessor IHttpContextAccessor

The request, for its issuer.

tickets IServerSideTicketStore

The server-side sessions, when they are on: where the user is read from first.

Methods

ValidateRequestAsync(string, CancellationToken)

Validates a UserInfo request's access token and finds its user, as IUserInfoRequestValidator describes; a refusal is a result carrying the error, not an exception.

public virtual Task<UserInfoRequestValidationResult> ValidateRequestAsync(string accessToken, CancellationToken ct)

Parameters

accessToken string

The access token the request presented.

ct CancellationToken

Cancels the validation.

Returns

Task<UserInfoRequestValidationResult>

The token's claims and the user, or the error.

Exceptions

ArgumentException

accessToken is null or empty.