private async Task <bool> ValidateRequestedScopesAsync(NameValueCollection parameters) { var scopes = parameters.Get(Constants.TokenRequest.Scope); if (scopes.IsMissingOrTooLong(Constants.MaxScopeLength)) { Logger.Warn("Scopes missing or too long"); return(false); } var requestedScopes = ScopeValidator.ParseScopesString(scopes); if (requestedScopes == null) { return(false); } if (!_scopeValidator.AreScopesAllowed(_validatedRequest.Client, requestedScopes)) { return(false); } if (!await _scopeValidator.AreScopesValidAsync(requestedScopes)) { return(false); } _validatedRequest.Scopes = requestedScopes; _validatedRequest.ValidatedScopes = _scopeValidator; return(true); }
private async Task <bool> ValidateRequestedScopesAsync(NameValueCollection parameters) { var requestedScopes = ScopeValidator.ParseScopesString(parameters.Get(Constants.TokenRequest.Scope)); if (requestedScopes == null) { return(false); } if (!_scopeValidator.AreScopesAllowed(_validatedRequest.Client, requestedScopes)) { return(false); } if (!await _scopeValidator.AreScopesValidAsync(requestedScopes)) { return(false); } _validatedRequest.Scopes = requestedScopes; _validatedRequest.ValidatedScopes = _scopeValidator; return(true); }