拓恒统一认证授权服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
1234567891011121314151617181920212223242526272829303132
  1. Server端 项目
  2. 第一步:登录授权获取code:
  3. http://127.0.0.1:8090/oauth2/authorize?
  4. client_id=tuoheng-dsp-web
  5. &response_type=code
  6. &scope=openid+profile
  7. &redirect_uri=http://192.168.11.11:8086/home
  8. &state=4991a0e66547452286dd56e0d9473a0e
  9. &code_challenge=GoX2z51GyLtItvCxPY4fI0q4pzvOVhHy00xcFGQ20os&code_challenge_method=S256&response_mode=query
  10. 扩展PKCE协议:(&code_challenge=IHicvKyz0IM1do9-3n9QpHf9xVluBshdD1vCD77gV7s&code_challenge_method=S256&response_mode=fragment)
  11. 第二步:根据code获取token:
  12. http://127.0.0.1:8090/oauth2/token
  13. 返回结果:
  14. {
  15. "access_token": "eyJraWQiOiJhYjg4YTUyNS02ZTRiLTQ0ODMtYTA3MS1lODU1YzIwOGE1ZjkiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImF1ZCI6ImpzLnRva2VubWFuYWdlciIsIm5iZiI6MTY2MzY2MDQ3OSwic2NvcGUiOlsib3BlbmlkIiwicm9sZXMiLCJlbWFpbCJdLCJpc3MiOiJodHRwOlwvXC8xMjcuMC4wLjE6ODA5MCIsImV4cCI6MTY2MzY2NzY3OSwiaWF0IjoxNjYzNjYwNDc5fQ.hwbfRT-wl-YV3lfArRu_hqQsikk8EVxOpib50c_BZSEsdATOnucpKEtGE8bnQQD6NHim7bL7rQYwP7YyA94UBkMROFkN-tw3VL9BgNBG2OK5QxOVVsnTLnu1H890oboh_7L1VkdPeFwyj6XxgkakMS1mNWkyT_5TZJDs0kmN3dTojFc5LL-s1WVWBNRzZhyDEe6U-5o1kxoSk5G6sxwHIS750vPMZJqZlSUqqDR5Sl5GtwfkKVjdHvVWVaCxwwlK6ZjEAHA0H9sniF7rLqx0uIiwfPSFOLaEqSSe7-JANY76tkIvZYVDphyh2qGUn9aCgXx-LXi1oT7J2N1bTS8fJQ",
  16. "refresh_token": "8hKqtmtsUwoZEkJt5jxT302cyOV9lir7FAAjcSIZiaO588Vz4XrlOuyO1AdAYq90FTefeBpKPewWLlkPAU_OnPgWZU4JNxplXQ99yvGBBglkIkVSlApXk6PgmYvO1jlh",
  17. "scope": "openid roles email",
  18. "id_token": "eyJraWQiOiJhYjg4YTUyNS02ZTRiLTQ0ODMtYTA3MS1lODU1YzIwOGE1ZjkiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImF1ZCI6ImpzLnRva2VubWFuYWdlciIsImF6cCI6ImpzLnRva2VubWFuYWdlciIsImlzcyI6Imh0dHA6XC9cLzEyNy4wLjAuMTo4MDkwIiwiZXhwIjoxNjYzNjYyMjc5LCJpYXQiOjE2NjM2NjA0Nzl9.gNNXLQJlDxGiG8tWkt-z9rqnboCuv8-978-mvLSFXF5VpZyiO9gjbGRdlMDpsTFVYu9OdV1vq-4IpGZjh08JWCt051epJ-s4rnFoSWKQajY2Qq94X2ZrCGs7yJX8oQM6MrCZ12_LOmoV216pHOxz9XxQ5O2xXuFXZkFCHbQozGxhitlXWY0y-Ivio7GCVxjaNEBP_JFACzGiU4QH2lMytpg4GUWIvlAmjMg9cuoQqoOqY43CtEQaIfCZ38Qlenx0sfXrfLnF3ci6hnRcP8pnB2aVUEr6o3xRbKWExQaDGRK9SzGpWqNRfcjQ0FNmkuSglMg5gnj4A7yTqJE-KhXQaQ",
  19. "token_type": "Bearer",
  20. "expires_in": 7199
  21. }
  22. 第三步:根据token获取userinfo
  23. http://127.0.0.1:8090/userinfo
  24. {
  25. "sub": "user",
  26. "email": "user@163.com",
  27. "email_verified": true
  28. }