Guest User

Untitled

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