Ejemplo n.º 1
0
        public async Task <DiscoveryInformation> Execute()
        {
            var result = new DiscoveryInformation();

            // Returns only the exposed scopes
            var scopes = await _scopeRepository.GetAllAsync();

            var scopeSupportedNames = new string[0];

            if (scopes != null ||
                scopes.Any())
            {
                scopeSupportedNames = scopes.Where(s => s.IsExposed).Select(s => s.Name).ToArray();
            }

            var responseTypesSupported = GetSupportedResponseTypes(Constants.Supported.SupportedAuthorizationFlows);

            var grantTypesSupported      = GetSupportedGrantTypes();
            var tokenAuthMethodSupported = GetSupportedTokenEndPointAuthMethods();

            result.ClaimsParameterSupported      = true;
            result.RequestParameterSupported     = true;
            result.RequestUriParameterSupported  = true;
            result.RequireRequestUriRegistration = true;
            result.ClaimsSupported                  = (await _claimRepository.GetAllAsync()).Select(c => c.Code).ToArray();
            result.ScopesSupported                  = scopeSupportedNames;
            result.ResponseTypesSupported           = responseTypesSupported;
            result.ResponseModesSupported           = Constants.Supported.SupportedResponseModes.ToArray();
            result.GrantTypesSupported              = grantTypesSupported;
            result.SubjectTypesSupported            = Constants.Supported.SupportedSubjectTypes.ToArray();
            result.TokenEndpointAuthMethodSupported = tokenAuthMethodSupported;
            result.IdTokenSigningAlgValuesSupported = Constants.Supported.SupportedJwsAlgs.ToArray();

            return(result);
        }
Ejemplo n.º 2
0
 public Task <List <Scope> > GetAllAsync()
 {
     return(_scopeRepository.GetAllAsync());
 }
 public Task <ICollection <Scope> > Execute()
 {
     return(_scopeRepository.GetAllAsync());
 }