Interface IExtensionGrantValidator
- Namespace
- Fdyay.IdentityServer.Validation
- Assembly
- Fdyay.IdentityServer.Core.dll
Implements a grant this server does not have, for a host that needs one.
public interface IExtensionGrantValidator
Remarks
The seam that makes AllowedGrantTypes honest. It has always been a collection of plain
strings, so a host could register a client for anything — and until 0.28.0 there was nothing it could then do
to make that grant work, because the token endpoint's set of grants was a switch and everything outside
it fell to the default arm.
A registered validator makes its GrantType supported: the token endpoint will route to it, and
the discovery document will name it. That is why the grant type must not collide with a built-in or with
another validator — the first would be shadowed by the switch and the second by whichever registration
won, and in both cases the validator would be configured, advertised, and never called.
UseIdentityServer() refuses to start on either collision rather than letting it happen quietly.
What a validator decides is who the token is for. What it may reach is not its decision: the requested scopes are checked against the client's registration and the resource store exactly as they are for every other grant, so a host cannot widen a client's reach by writing a grant.
Properties
GrantType
The grant_type this validator answers to.
string GrantType { get; }
Property Value
Methods
ValidateAsync(ExtensionGrantValidationContext, CancellationToken)
Resolves the grant, or explains why it does not resolve.
Task<ExtensionGrantValidationResult> ValidateAsync(ExtensionGrantValidationContext context, CancellationToken cancellationToken = default)
Parameters
contextExtensionGrantValidationContextcancellationTokenCancellationToken