-
-
Save gdyrrahitis/2cf89e8d40f72ec522379fdc60282815 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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