diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2020-08-06 23:28:30 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2020-08-06 23:28:30 +0200 |
| commit | d7b5f8b7775a7c623d4bcfa7015476f835aabfa2 (patch) | |
| tree | 72c1daf1a0b66765c16217c416173310dd73c214 /src/server/IdentityServer/Config.cs | |
| parent | 0cdb0b7ee3cd80ddb089344e80be2c4b46d75364 (diff) | |
| download | dough-d7b5f8b7775a7c623d4bcfa7015476f835aabfa2.tar.xz dough-d7b5f8b7775a7c623d4bcfa7015476f835aabfa2.zip | |
server: start of ids4 impl
Diffstat (limited to 'src/server/IdentityServer/Config.cs')
| -rw-r--r-- | src/server/IdentityServer/Config.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/server/IdentityServer/Config.cs b/src/server/IdentityServer/Config.cs new file mode 100644 index 0000000..41363f1 --- /dev/null +++ b/src/server/IdentityServer/Config.cs @@ -0,0 +1,48 @@ +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<Client> Clients => new List<Client> + { + 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<ApiScope> ApiScopes => + new List<ApiScope> + { + new ApiScope(MainApiScopeName) + }; + + public static IEnumerable<IdentityResource> IdentityResources => + new List<IdentityResource> + { + new IdentityResources.OpenId(), + new IdentityResources.Profile(), + }; + } +} |
