token.http 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  2. # Copyright 2016-present the original author or authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # https://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. ### 生成用户 Salt
  17. #/auth/token/salt
  18. POST http://{{dc3-auth}}/auth/token/salt
  19. Accept: */*
  20. Content-Type: application/json
  21. Cache-Control: no-cache
  22. {
  23. "name": "pnoker"
  24. }
  25. ### 生成用户 Token 令牌
  26. #/auth/token/generate
  27. # pnoker/10e339be1130a90dc1b9ff0332abced6
  28. # DC3Util.md5("10e339be1130a90dc1b9ff0332abced6"+"verfdkkq")
  29. POST http://{{dc3-auth}}/auth/token/generate
  30. Accept: */*
  31. Content-Type: application/json
  32. Cache-Control: no-cache
  33. {
  34. "tenant": "default",
  35. "name": "pnoker",
  36. "salt": "dsb785i4ikx0h4wt",
  37. "password": "8f9812cee01121acb1f3cab6a08e58c4"
  38. }
  39. ### 检测用户 Token 令牌是否有效
  40. #/auth/token/:token
  41. POST http://{{dc3-auth}}/auth/token/check
  42. Accept: */*
  43. Content-Type: application/json
  44. Cache-Control: no-cache
  45. {
  46. "name": "pnoker",
  47. "salt": "dsb785i4ikx0h4wt",
  48. "token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJwbm9rZXIvZGMzIiwic3ViIjoicG5va2VyIiwiaWF0IjoxNjIyMTEwNTE5LCJleHAiOjE2MjIxNTM3MTl9.WeE8iLppqPhNNqhNFTlGvEiq6EQBhdxb7z8AER8N_vQ"
  49. }
  50. ### 注销用户 Token 令牌
  51. #/auth/token/cancel
  52. POST http://{{dc3-auth}}/auth/token/cancel
  53. Accept: */*
  54. Content-Type: application/json
  55. Cache-Control: no-cache
  56. {
  57. "name": "pnoker"
  58. }