Пример #1
0
 public virtual async Task Enrich(JObject jObj, string issuer, CancellationToken cancellationToken)
 {
     jObj.Add(OAuthConfigurationNames.TlsClientCertificateBoundAccessTokens, true);
     jObj.Add(OAuthConfigurationNames.ScopesSupported, JArray.FromObject((await _oauthScopeRepository.GetAllOAuthScopesExposed(cancellationToken)).Select(s => s.Name).ToList()));
     jObj.Add(OAuthConfigurationNames.ResponseTypesSupported, JArray.FromObject(GetResponseTypes()));
     jObj.Add(OAuthConfigurationNames.ResponseModesSupported, JArray.FromObject(_oauthResponseModes.Select(s => s.ResponseMode)));
     jObj.Add(OAuthConfigurationNames.GrantTypesSupported, JArray.FromObject(GetGrantTypes()));
     jObj.Add(OAuthConfigurationNames.TokenEndpointAuthMethodsSupported, JArray.FromObject(_oauthClientAuthenticationHandlers.Select(r => r.AuthMethod)));
     jObj.Add(OAuthConfigurationNames.TokenEndpointAuthSigningAlgValuesSupported, JArray.FromObject(_signHandlers.Select(s => s.AlgName)));
     if (_options.MtlsEnabled)
     {
         jObj.Add(OAuthConfigurationNames.MtlsEndpointAliases, new JObject
         {
             { OAuthConfigurationNames.TokenEndpoint, $"{issuer}/{Constants.EndPoints.MtlsToken}" }
         });
     }
 }