public static IEnumerable <IdentityResource> GetIdentityResources(IConfiguration configuration) { var resourcesConfig = new List <string>(); configuration.GetSection("ApplicationSettings").GetSection("AuthConfig").GetSection("IdentityResources").Bind(resourcesConfig); return(resourcesConfig.Select(r => AuthVariables.GetIdentityResource(r)).ToArray()); }
public static IEnumerable <Client> GetClients(IConfiguration configuration) { var resourcesConfig = new List <ClientAuthConfig>(); configuration.GetSection("ApplicationSettings").GetSection("AuthConfig").GetSection("Clients").Bind(resourcesConfig); return(resourcesConfig.Select(r => new Client { ClientId = r.ClientId, ClientName = r.ClientName, ClientSecrets = r.ClientSecrets, AllowedGrantTypes = AuthVariables.GetAllowedGrantTypes(r.AllowedGrantTypesName), AllowedScopes = r.AllowedScopes, AllowAccessTokensViaBrowser = r.AllowAccessTokensViaBrowser, RedirectUris = r.RedirectUris, PostLogoutRedirectUris = r.PostLogoutRedirectUris, AllowedCorsOrigins = r.AllowedCorsOrigins, RequireConsent = r.RequireConsent })); }