aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/IdentityServer/Config.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/IdentityServer/Config.cs')
-rw-r--r--src/server/IdentityServer/Config.cs48
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(),
+ };
+ }
+}