Identity Server reference
This commit is contained in:
parent
7cc450a648
commit
f66dac31c9
5 changed files with 99 additions and 19 deletions
52
src/Yavsc/Config.cs
Normal file
52
src/Yavsc/Config.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using Duende.IdentityServer.Models;
|
||||
|
||||
namespace Yavsc;
|
||||
|
||||
public static class Config
|
||||
{
|
||||
public static IEnumerable<IdentityResource> IdentityResources =>
|
||||
new IdentityResource[]
|
||||
{
|
||||
new IdentityResources.OpenId(),
|
||||
new IdentityResources.Profile(),
|
||||
};
|
||||
|
||||
public static IEnumerable<ApiScope> ApiScopes =>
|
||||
new ApiScope[]
|
||||
{
|
||||
new ApiScope("scope1"),
|
||||
new ApiScope("scope2"),
|
||||
};
|
||||
|
||||
public static IEnumerable<Client> Clients =>
|
||||
new Client[]
|
||||
{
|
||||
// m2m client credentials flow client
|
||||
new Client
|
||||
{
|
||||
ClientId = "m2m.client",
|
||||
ClientName = "Client Credentials Client",
|
||||
|
||||
AllowedGrantTypes = GrantTypes.ClientCredentials,
|
||||
ClientSecrets = { new Secret("511536EF-F270-4058-80CA-1C89C192F69A".Sha256()) },
|
||||
|
||||
AllowedScopes = { "scope1" }
|
||||
},
|
||||
|
||||
// interactive client using code flow + pkce
|
||||
new Client
|
||||
{
|
||||
ClientId = "interactive",
|
||||
ClientSecrets = { new Secret("49C1A7E1-0C79-4A89-A3D6-A37998FB86B0".Sha256()) },
|
||||
|
||||
AllowedGrantTypes = GrantTypes.Code,
|
||||
|
||||
RedirectUris = { "https://localhost:5001/signin-oidc" },
|
||||
FrontChannelLogoutUri = "https://localhost:5001/signout-oidc",
|
||||
PostLogoutRedirectUris = { "https://localhost:5001/signout-callback-oidc" },
|
||||
|
||||
AllowOfflineAccess = true,
|
||||
AllowedScopes = { "openid", "profile", "scope2" }
|
||||
},
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue