Interface IResourceValidator
- Namespace
- Fdyay.IdentityServer.Validation
- Assembly
- Fdyay.IdentityServer.Core.dll
Validates requested scopes against a client and the resource store.
public interface IResourceValidator
Methods
ValidateAsync(Client, IEnumerable<string>, CancellationToken)
Validates the scope values client asked for against its allowed scopes and the resource store.
Task<ResourceValidationResult> ValidateAsync(Client client, IEnumerable<string> requestedScopes, CancellationToken cancellationToken = default)
Parameters
clientClientThe client asking.
requestedScopesIEnumerable<string>The scope values asked for.
cancellationTokenCancellationTokenCancels the resource store lookups.
Returns
- Task<ResourceValidationResult>
The resources and scope values granted, and the values that were not; Succeeded says whether every value was valid.
ValidateRequestedResourcesAsync(ResourceValidationRequest, CancellationToken)
Validates the scopes a client asked for, and the resource indicators beside them. Duende's.
Task<ResourceValidationResult> ValidateRequestedResourcesAsync(ResourceValidationRequest request, CancellationToken ct = default)
Parameters
requestResourceValidationRequestctCancellationToken
Returns
Remarks
Duende 8.0.1's DefaultResourceValidator.ValidateRequestedResourcesAsync, measured — Duende's interface has only
this — answered here from ValidateAsync(Client, IEnumerable<string>, CancellationToken), so a validator that implements only that one judges the
indicators the same way. With indicators, the APIs the scopes reach are kept when they do not require one
(RequireResourceIndicator) or are named, and an indicator naming none of them is invalid;
without, an API that requires one is left out. A result with anything invalid grants nothing. Malformed indicators
are the caller's to refuse, not to pass, as Duende's callers refuse them before asking.