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
tokensITokenValidatorValidates the access token.
profileIProfileServiceAsked whether the user is still active.
clientsIClientStoreThe client the token was issued to, which must still be served.
issuerNameServiceIIssuerNameServiceThis server's issuer, which the token is validated against.
httpContextAccessorIHttpContextAccessorThe request, for its issuer.
ticketsIServerSideTicketStoreThe 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
accessTokenstringThe access token the request presented.
ctCancellationTokenCancels the validation.
Returns
- Task<UserInfoRequestValidationResult>
The token's claims and the user, or the error.
Exceptions
- ArgumentException
accessTokenis null or empty.