-
Notifications
You must be signed in to change notification settings - Fork 6
/
Config.cs
78 lines (70 loc) · 2.96 KB
/
Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using IdentityServer4.Models;
using System.Collections.Generic;
namespace IdentityProvider
{
public static class Config
{
public static IEnumerable<IdentityResource> IdentityResources =>
new IdentityResource[]
{
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
new IdentityResource("roles", "User role(s)", new List<string> { "role" })
};
public static IEnumerable<ApiScope> ApiScopes =>
new ApiScope[]
{
new ApiScope("weatherapiread")
};
public static IEnumerable<ApiResource> ApiResources =>
new ApiResource[]
{
new ApiResource("weatherapi", "The Weather API")
{
Scopes = new [] { "weatherapiread" }
}
};
public static IEnumerable<Client> Clients =>
new Client[]
{
new Client
{
ClientId = "blazorhybridapp",
AllowedGrantTypes = GrantTypes.Code,
RequirePkce = true,
RequireClientSecret = false,
AllowedScopes = { "openid", "profile", "weatherapiread" },
RedirectUris = { "myapp://callback" },
PostLogoutRedirectUris = { "myapp://callback" },
Enabled = true
},
new Client
{
ClientId = "blazorwebassemblyapp",
AllowedGrantTypes = GrantTypes.Code,
RequirePkce = true,
RequireClientSecret = false,
AllowedCorsOrigins = { "https://localhost:44310" },
AllowedScopes = { "openid", "profile", "weatherapiread" },
RedirectUris = { "https://localhost:44310/authentication/login-callback" },
PostLogoutRedirectUris = { "https://localhost:44310/" },
Enabled = true
},
new Client
{
ClientId = "blazorserverapp",
AllowedGrantTypes = GrantTypes.Code,
ClientSecrets = { new Secret("blazorserverappsecret".Sha256()) },
RequirePkce = true,
RequireClientSecret = false,
AllowedCorsOrigins = { "https://localhost:44300" },
AllowedScopes = { "openid", "profile", "weatherapiread" },
RedirectUris = { "https://localhost:44300/signin-oidc" },
PostLogoutRedirectUris = { "https://localhost:44300/" },
Enabled = true
},
};
}
}