Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. public static IEnumerable<ApiResource> GetApis()
  2. {
  3. return new List<ApiResource>
  4. {
  5. new ApiResource("CustomerManagementApi", "My CustomerManagementApi"),
  6. new ApiResource("DashboardApi", "My DashboardApi"),
  7. // others ...
  8. };
  9. }
  10.  
  11. public static IEnumerable<Client> GetClients()
  12. {
  13. return new List<Client>
  14. {
  15. new Client
  16. {
  17. ClientId = "client",
  18.  
  19. // no interactive user, use the clientid/secret for authentication
  20. AllowedGrantTypes = GrantTypes.ClientCredentials,
  21.  
  22. // secret for authentication
  23. ClientSecrets =
  24. {
  25. new Secret("secret".Sha256())
  26. },
  27.  
  28. // scopes that client has access to
  29. AllowedScopes = { "CustomerManagementApi" }
  30. }
  31. };
  32. }
  33.  
  34. public static List<TestUser> GetUsers()
  35. {
  36. return new List<TestUser>
  37. {
  38. new TestUser
  39. {
  40. SubjectId = "1",
  41. Username = "alice",
  42. Password = "password"
  43. },
  44. new TestUser
  45. {
  46. SubjectId = "2",
  47. Username = "bob",
  48. Password = "password"
  49. }
  50. };
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement