55using Microsoft . Extensions . Configuration ;
66using System . Collections . Generic ;
77
8- namespace StsServerIdentity
8+ namespace StsServerIdentity ;
9+
10+ public class Config
911{
10- public class Config
12+ public static IEnumerable < IdentityResource > GetIdentityResources ( )
1113 {
12- public static IEnumerable < IdentityResource > GetIdentityResources ( )
14+ return new List < IdentityResource >
1315 {
14- return new List < IdentityResource >
15- {
16- new IdentityResources . OpenId ( ) ,
17- new IdentityResources . Profile ( ) ,
18- new IdentityResources . Email ( )
19- } ;
20- }
16+ new IdentityResources . OpenId ( ) ,
17+ new IdentityResources . Profile ( ) ,
18+ new IdentityResources . Email ( )
19+ } ;
20+ }
2121
22- public static IEnumerable < ApiScope > GetApiScopes ( )
22+ public static IEnumerable < ApiScope > GetApiScopes ( )
23+ {
24+ return new List < ApiScope >
2325 {
24- return new List < ApiScope >
25- {
26- //new ApiScope("dataEventRecords", "Scope for the dataEventRecords ApiResource"),
27- //new ApiScope("securedFiles", "Scope for the securedFiles ApiResource")
28- } ;
29- }
26+ //new ApiScope("dataEventRecords", "Scope for the dataEventRecords ApiResource"),
27+ //new ApiScope("securedFiles", "Scope for the securedFiles ApiResource")
28+ } ;
29+ }
3030
31- public static IEnumerable < ApiResource > GetApiResources ( )
31+ public static IEnumerable < ApiResource > GetApiResources ( )
32+ {
33+ return new List < ApiResource >
3234 {
33- return new List < ApiResource >
34- {
35- //new ApiResource("dataEventRecordsApi")
36- //{
37- // ApiSecrets =
38- // {
39- // new Secret("dataEventRecordsSecret".Sha256())
40- // },
41- // Scopes = new List<string> { "dataEventRecords" }
42- //},
43- //new ApiResource("securedFilesApi")
44- //{
45- // ApiSecrets =
46- // {
47- // new Secret("securedFilesSecret".Sha256())
48- // },
49- // Scopes = new List<string> { "securedFiles" }
50- //}
51- } ;
52- }
35+ //new ApiResource("dataEventRecordsApi")
36+ //{
37+ // ApiSecrets =
38+ // {
39+ // new Secret("dataEventRecordsSecret".Sha256())
40+ // },
41+ // Scopes = new List<string> { "dataEventRecords" }
42+ //},
43+ //new ApiResource("securedFilesApi")
44+ //{
45+ // ApiSecrets =
46+ // {
47+ // new Secret("securedFilesSecret".Sha256())
48+ // },
49+ // Scopes = new List<string> { "securedFiles" }
50+ //}
51+ } ;
52+ }
5353
54- public static IEnumerable < Client > GetClients ( IConfigurationSection stsConfig )
55- {
56- // TODO use configs in app
57- //var yourConfig = stsConfig["ClientUrl"];
54+ public static IEnumerable < Client > GetClients ( IConfigurationSection stsConfig )
55+ {
56+ // TODO use configs in app
57+ //var yourConfig = stsConfig["ClientUrl"];
5858
59- return new List < Client >
60- {
61- // example code
62- //new Client
63- //{
64- // ClientName = "angularclient",
65- // ClientId = "angularclient",
66- // AccessTokenType = AccessTokenType.Reference,
67- // AccessTokenLifetime = 330,// 330 seconds, default 60 minutes
68- // IdentityTokenLifetime = 30,
69- // AllowedGrantTypes = GrantTypes.Implicit,
70- // AllowAccessTokensViaBrowser = true,
71- // RedirectUris = new List<string>
72- // {
73- // "https://localhost:44311",
74- // "https://localhost:44311/silent-renew.html"
59+ return new List < Client >
60+ {
61+ // example code
62+ //new Client
63+ //{
64+ // ClientName = "angularclient",
65+ // ClientId = "angularclient",
66+ // AccessTokenType = AccessTokenType.Reference,
67+ // AccessTokenLifetime = 330,// 330 seconds, default 60 minutes
68+ // IdentityTokenLifetime = 30,
69+ // AllowedGrantTypes = GrantTypes.Implicit,
70+ // AllowAccessTokensViaBrowser = true,
71+ // RedirectUris = new List<string>
72+ // {
73+ // "https://localhost:44311",
74+ // "https://localhost:44311/silent-renew.html"
7575
76- // },
77- // PostLogoutRedirectUris = new List<string>
78- // {
79- // "https://localhost:44311/unauthorized",
80- // "https://localhost:44311"
81- // },
82- // AllowedCorsOrigins = new List<string>
83- // {
84- // "https://localhost:44311",
85- // "http://localhost:44311"
86- // },
87- // AllowedScopes = new List<string>
88- // {
89- // "openid",
90- // "role",
91- // "profile",
92- // "email"
93- // }
94- //}
95- } ;
96- }
76+ // },
77+ // PostLogoutRedirectUris = new List<string>
78+ // {
79+ // "https://localhost:44311/unauthorized",
80+ // "https://localhost:44311"
81+ // },
82+ // AllowedCorsOrigins = new List<string>
83+ // {
84+ // "https://localhost:44311",
85+ // "http://localhost:44311"
86+ // },
87+ // AllowedScopes = new List<string>
88+ // {
89+ // "openid",
90+ // "role",
91+ // "profile",
92+ // "email"
93+ // }
94+ //}
95+ } ;
9796 }
9897}
0 commit comments