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, AccessTokenType = AccessTokenType.Reference, RequireConsent = false, RefreshTokenExpiration = TokenExpiration.Sliding, AlwaysSendClientClaims = true, AllowOfflineAccess = true, Claims = new List { new ClientClaim() }, AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, IdentityServerConstants.StandardScopes.OfflineAccess, MainApiScopeName } } }; public static IEnumerable ApiScopes => new List { new ApiScope(MainApiScopeName) }; public static IEnumerable IdentityResources => new List { new IdentityResources.OpenId(), new IdentityResources.Profile(), }; } }