public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddIdentityServer() | |
.AddDeveloperSigningCredential() | |
.AddInMemoryApiResources(new List<ApiResource> | |
{ | |
new ApiResource("resource.server.api", | |
new [] { ClaimTypes.Name, ClaimTypes.Email}) | |
}) | |
.AddInMemoryClients(new List<Client> | |
{ | |
new Client | |
{ | |
ClientId = "angular.client", | |
ClientName = "Angular Client", | |
ClientSecrets = new [] { new Secret("secret".Sha256()) }, | |
AllowedScopes = new [] { "resource.server.api" }, | |
AllowedGrantTypes = GrantTypes.ResourceOwnerPassword, | |
AllowedCorsOrigins = new [] { "http://localhost:4200/" } | |
} | |
}) | |
.AddTestUsers(new List<TestUser> | |
{ | |
new TestUser | |
{ | |
SubjectId = "1", | |
Username = "user", | |
Password = "1234", | |
Claims = new List<Claim> | |
{ | |
new Claim(ClaimTypes.Name, "Test User"), | |
new Claim(ClaimTypes.Email, "email@mail.com") | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment