-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.cs
More file actions
78 lines (65 loc) · 2.52 KB
/
Config.cs
File metadata and controls
78 lines (65 loc) · 2.52 KB
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;
using IdentityServer4.Models;
using System.Collections.Generic;
/*
THIS FILE IS NOT USED
*/
namespace IdentityCore
{
public static class Config
{
private static string JsClientHost = "http://localhost:3000";
public static IEnumerable<IdentityResource> IdentityResources =>
new List<IdentityResource>
{
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
};
public static IEnumerable<ApiResource> ApiResources =>
new List<ApiResource> {
new ApiResource("catApi", "Api providing cat facts")
{
Scopes = { "catApi.fact", "catApi.user" }
}
};
public static IEnumerable<ApiScope> ApiScopes =>
new List<ApiScope>
{
new ApiScope("api1", "My API"),
new ApiScope("catApi.fact", "Get fact about cat"),
new ApiScope("catApi.user", "Get user info")
};
public static IEnumerable<Client> Clients =>
new List<Client>
{
new Client
{
ClientId = "js",
ClientName = "JavaScript Client",
AllowedGrantTypes = GrantTypes.Code,
RequireClientSecret = false,
RefreshTokenUsage = TokenUsage.OneTimeOnly,
RefreshTokenExpiration = TokenExpiration.Absolute,
AbsoluteRefreshTokenLifetime = 60 * 60,
AccessTokenLifetime = 60 * 10,
RedirectUris = {
$"{JsClientHost}",
$"{JsClientHost}/#/signin-oidc",
$"{JsClientHost}/#/silentrenew" },
PostLogoutRedirectUris = { $"{JsClientHost}" },
AllowedCorsOrigins = { $"{JsClientHost}" },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
"api1",
"catApi.fact",
"catApi.user"
},
RequireConsent = false,
}
};
}
}