Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Duende.IdentityServer;
- using Duende.IdentityServer.Models;
- using IdentityModel;
- namespace HeadhuntNow.Auth;
- public class Config
- {
- private IConfiguration Configuration { get; set; }
- public Config(IConfiguration configuration)
- {
- Configuration = configuration;
- }
- public IEnumerable<IdentityResource> IdentityResources =>
- new List<IdentityResource>
- {
- new IdentityResources.OpenId(),
- new IdentityResources.Profile(),
- new()
- {
- Name = "verification",
- UserClaims = new List<string>
- {
- JwtClaimTypes.Email,
- JwtClaimTypes.EmailVerified
- }
- }
- };
- public IEnumerable<ApiScope> ApiScopes =>
- new List<ApiScope>
- {
- };
- public IEnumerable<ApiResource> ApiResources =>
- new List<ApiResource>
- {
- };
- public IEnumerable<Client> GetClients() =>
- new Client[]
- {
- new Client
- {
- ClientId = "dev",
- ClientSecrets = { new Secret("secret".ToSha256()) },
- AllowedGrantTypes = GrantTypes.Code,
- EnableLocalLogin = true,
- ClientName = "Local Web",
- AllowedScopes = new List<string>
- {
- IdentityServerConstants.StandardScopes.OpenId,
- IdentityServerConstants.StandardScopes.Profile,
- "verification",
- },
- ClientUri = "https://localhost:5137",
- AllowedCorsOrigins = new List<string>()
- {
- "https://localhost:5137",
- },
- // where to redirect to after login
- RedirectUris =
- {
- // $"{Configuration["LoginRedirect"]}/signin-oidc"
- "https://localhost:5137/signin-oidc",
- "https://localhost:5137/authentication/login-callback",
- "https://localhost:5137/connect/authorize",
- },
- PostLogoutRedirectUris =
- {
- $"https://localhost:5137/signout-callback-oidc",
- $"https://localhost:5137/authentication/signout-callback-oidc",
- },
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment