您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TokenValidationHandler.cs 830B

123456789101112131415161718192021222324252627
  1. using Authentication_test.DBO;
  2. using iiie.Authentication.DBO;
  3. namespace Authentication_test.Controllers.Authentication
  4. {
  5. public class TokenValidationHandler : iiie.Authentication.Business.JWT.TokenValidationHandler
  6. {
  7. protected override BasicUserDbo GetUserDbo(string username, string salt)
  8. {
  9. if (username == "root")
  10. return new BasicUserDbo
  11. {
  12. Id = 42,
  13. Role = (int)UserRoles.Root,
  14. Username = "Root"
  15. };
  16. if (username == "notroot")
  17. return new BasicUserDbo
  18. {
  19. Id = 4242,
  20. Role = (int)UserRoles.NotRoot,
  21. Username = "Not Root"
  22. };
  23. return null;
  24. }
  25. }
  26. }