示例#1
0
        public override async Task <IActionResult> Get(CancellationToken token)
        {
            var issuer = Request.GetAbsoluteUriWithVirtualPath();
            var acrLst = await _authenticationContextClassReferenceQueryRepository.GetAllACR(token);

            var result = await Build();

            var openidScopes = (await _oauthScopeQueryRepository.GetAllOAuthScopes()).Cast <OpenIdScope>().SelectMany(s => s.Claims).Where(c => c.IsExposed).Select(s => s.ClaimName);

            result.Add(OpenIDConfigurationNames.UserInfoEndpoint, $"{issuer}/{SIDOpenIdConstants.EndPoints.UserInfo}");
            result.Add(OpenIDConfigurationNames.CheckSessionIframe, $"{issuer}/{SIDOpenIdConstants.EndPoints.CheckSession}");
            result.Add(OpenIDConfigurationNames.EndSessionEndpoint, $"{issuer}/{SIDOpenIdConstants.EndPoints.EndSession}");
            result.Add(OpenIDConfigurationNames.RequestParameterSupported, true);
            result.Add(OpenIDConfigurationNames.RequestUriParameterSupported, true);
            result.Add(OpenIDConfigurationNames.RequestObjectSigningAlgValuesSupported, JArray.FromObject(_signHandlers.Select(_ => _.AlgName)));
            result.Add(OpenIDConfigurationNames.RequestObjectEncryptionAlgValuesSupported, JArray.FromObject(_cekHandlers.Select(r => r.AlgName)));
            result.Add(OpenIDConfigurationNames.RequestObjectEncryptionEncValuesSupported, JArray.FromObject(_encHandlers.Select(r => r.EncName)));
            result.Add(OpenIDConfigurationNames.SubjectTypesSupported, JArray.FromObject(_subjectTypeBuilders.Select(r => r.SubjectType)));
            result.Add(OpenIDConfigurationNames.AcrValuesSupported, JArray.FromObject(acrLst.Select(_ => _.Name)));
            result.Add(OpenIDConfigurationNames.IdTokenSigningAlgValuesSupported, JArray.FromObject(_signHandlers.Select(_ => _.AlgName)));
            result.Add(OpenIDConfigurationNames.IdTokenEncryptionAlgValuesSupported, JArray.FromObject(_cekHandlers.Select(r => r.AlgName)));
            result.Add(OpenIDConfigurationNames.IdTokenEncryptionEncValuesSupported, JArray.FromObject(_encHandlers.Select(r => r.EncName)));
            result.Add(OpenIDConfigurationNames.UserInfoSigningAlgValuesSupported, JArray.FromObject(_signHandlers.Select(_ => _.AlgName)));
            result.Add(OpenIDConfigurationNames.UserInfoEncryptionAlgValuesSupported, JArray.FromObject(_cekHandlers.Select(r => r.AlgName)));
            result.Add(OpenIDConfigurationNames.UserInfoEncryptionEncValuesSupported, JArray.FromObject(_encHandlers.Select(r => r.EncName)));
            result.Add(OpenIDConfigurationNames.ClaimsSupported, JArray.FromObject(openidScopes));
            return(new OkObjectResult(result));
        }
示例#2
0
        public virtual async Task <IActionResult> GetScopes()
        {
            var result = await _oauthScopeQueryRepository.GetAllOAuthScopes();

            return(new OkObjectResult(result.Select(_ => ToDto(_))));
        }