Guest User

Untitled

a guest
Dec 2nd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using IdentityServer4.Models;
  3. using IdentityServer4.Test;
  4.  
  5. namespace App1
  6. {
  7. static class Config
  8. {
  9. public static IEnumerable<ApiResource> GetApiResources()
  10. {
  11. return new List<ApiResource>
  12. {
  13. new ApiResource("app2api", "My API")
  14. };
  15. }
  16. public static IEnumerable<Client> GetClients()
  17. {
  18. return new List<Client>
  19. {
  20. new Client
  21. {
  22. ClientId = "ro.client",
  23. AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
  24. ClientSecrets =
  25. {
  26. new Secret("secret".Sha256())
  27. },
  28. AllowedScopes = { "app2api" }
  29. }
  30. };
  31. }
  32. public static List<TestUser> GetUsers()
  33. {
  34. return new List<TestUser>
  35. {
  36. new TestUser
  37. {
  38. SubjectId = "1",
  39. Username = "alice",
  40. Password = "password"
  41. },
  42. new TestUser
  43. {
  44. SubjectId = "2",
  45. Username = "bob",
  46. Password = "password"
  47. }
  48. };
  49. }
  50.  
  51.  
  52.  
  53.  
  54. }
  55. }
Add Comment
Please, Sign In to add comment