Skip to content

Instantly share code, notes, and snippets.

@gdyrrahitis

gdyrrahitis/Startup.cs Secret

Last active Aug 18, 2018
Embed
What would you like to do?
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
You can’t perform that action at this time.