12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using IdentityServer4.Models;
- using IdentityServer4.Test;
- using System.Collections.Generic;
- namespace CasinosManager.IdentityServer
- {
- public class Config
- {
- // scopes define the API resources in your system
- public static IEnumerable<ApiResource> GetApiResources()
- {
- return new List<ApiResource>
- {
- new ApiResource("CasinosApi", "Casinos API")
- };
- }
- // clients want to access resources (aka scopes)
- public static IEnumerable<Client> GetClients()
- {
- // client credentials client
- return new List<Client>
- {
- // resource owner password grant client
- new Client
- {
- ClientId = "angular.client",
- AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
- ClientSecrets =
- {
- new Secret("secret".Sha256())
- },
- AllowedScopes = { "CasinosApi" }
- }
- };
- }
- public static List<TestUser> GetUsers()
- {
- return new List<TestUser>
- {
- new TestUser
- {
- SubjectId = "1",
- Username = "alice",
- Password = "password"
- },
- new TestUser
- {
- SubjectId = "2",
- Username = "bob",
- Password = "password"
- }
- };
- }
- }
- }
|