using System.Collections.Generic; using Dough.Models; using IdentityServer4; using IdentityServer4.Models; namespace Dough.IdentityServer { public static class Config { private const string MainApiScopeName = "main_api"; private const string BrowserClientId = "browser"; public static IEnumerable Clients => new List { new Client { ClientId = BrowserClientId, AllowedGrantTypes = GrantTypes.Code, RequireClientSecret = false, RedirectUris = Constants.BrowserAppLoginRedirectUrls, PostLogoutRedirectUris = Constants.BrowserAppLogoutRedirectUrls, AllowedCorsOrigins = Constants.BrowserAppUrls, AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, MainApiScopeName } } }; public static IEnumerable ApiScopes => new List { new ApiScope(MainApiScopeName) }; public static IEnumerable IdentityResources => new List { new IdentityResources.OpenId(), new IdentityResources.Profile(), }; } }