Class IntrospectionResponseGenerator
- Namespace
- Fdyay.IdentityServer.ResponseHandling
- Assembly
- Fdyay.IdentityServer.Core.dll
Duende's default introspection response generator, with this server's audience rule and events.
public class IntrospectionResponseGenerator : IIntrospectionResponseGenerator
- Inheritance
-
IntrospectionResponseGenerator
- Implements
- Inherited Members
Constructors
IntrospectionResponseGenerator(IEventService)
Creates the generator.
public IntrospectionResponseGenerator(IEventService events)
Parameters
eventsIEventServiceWhere the introspection success and failure events go.
Properties
Events
Where the introspection events go.
protected IEventService Events { get; }
Property Value
Methods
AreExpectedScopesPresentAsync(IntrospectionRequestValidationResult, CancellationToken)
Whether an API caller's token carries at least one of the API's scopes. Duende's.
protected virtual Task<bool> AreExpectedScopesPresentAsync(IntrospectionRequestValidationResult validationResult, CancellationToken ct)
Parameters
validationResultIntrospectionRequestValidationResultctCancellationToken
Returns
Remarks
A token carrying none is reported inactive, and the refusal raised as this server's failure event.
ProcessAsync(IntrospectionRequestValidationResult, CancellationToken)
Builds the introspection response (RFC 7662 ยง2.2) for a validated request.
public virtual Task<Dictionary<string, object>> ProcessAsync(IntrospectionRequestValidationResult validationResult, CancellationToken ct)
Parameters
validationResultIntrospectionRequestValidationResultThe validated introspection request, with the token's claims when it is active.
ctCancellationTokenCancels raising the introspection events.
Returns
- Task<Dictionary<string, object>>
The members of the JSON response:
active, and for an active token its claims.
Remarks
For an API caller the token is reported inactive unless its audience names that API and it carries at least one of
the API's scopes; scope is then narrowed to the API's own.
Exceptions
- ArgumentNullException
validationResultisnull.