|
- Server端 项目
- 第一步:登录授权获取code:
- http://127.0.0.1:8090/oauth2/authorize?
- client_id=tuoheng-dsp-web
- &response_type=code
- &scope=openid+profile
- &redirect_uri=http://192.168.11.11:8086/home
- &state=4991a0e66547452286dd56e0d9473a0e
-
- &code_challenge=GoX2z51GyLtItvCxPY4fI0q4pzvOVhHy00xcFGQ20os&code_challenge_method=S256&response_mode=query
-
- 扩展PKCE协议:(&code_challenge=IHicvKyz0IM1do9-3n9QpHf9xVluBshdD1vCD77gV7s&code_challenge_method=S256&response_mode=fragment)
-
- 第二步:根据code获取token:
- http://127.0.0.1:8090/oauth2/token
- 返回结果:
- {
- "access_token": "eyJraWQiOiJhYjg4YTUyNS02ZTRiLTQ0ODMtYTA3MS1lODU1YzIwOGE1ZjkiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImF1ZCI6ImpzLnRva2VubWFuYWdlciIsIm5iZiI6MTY2MzY2MDQ3OSwic2NvcGUiOlsib3BlbmlkIiwicm9sZXMiLCJlbWFpbCJdLCJpc3MiOiJodHRwOlwvXC8xMjcuMC4wLjE6ODA5MCIsImV4cCI6MTY2MzY2NzY3OSwiaWF0IjoxNjYzNjYwNDc5fQ.hwbfRT-wl-YV3lfArRu_hqQsikk8EVxOpib50c_BZSEsdATOnucpKEtGE8bnQQD6NHim7bL7rQYwP7YyA94UBkMROFkN-tw3VL9BgNBG2OK5QxOVVsnTLnu1H890oboh_7L1VkdPeFwyj6XxgkakMS1mNWkyT_5TZJDs0kmN3dTojFc5LL-s1WVWBNRzZhyDEe6U-5o1kxoSk5G6sxwHIS750vPMZJqZlSUqqDR5Sl5GtwfkKVjdHvVWVaCxwwlK6ZjEAHA0H9sniF7rLqx0uIiwfPSFOLaEqSSe7-JANY76tkIvZYVDphyh2qGUn9aCgXx-LXi1oT7J2N1bTS8fJQ",
- "refresh_token": "8hKqtmtsUwoZEkJt5jxT302cyOV9lir7FAAjcSIZiaO588Vz4XrlOuyO1AdAYq90FTefeBpKPewWLlkPAU_OnPgWZU4JNxplXQ99yvGBBglkIkVSlApXk6PgmYvO1jlh",
- "scope": "openid roles email",
- "id_token": "eyJraWQiOiJhYjg4YTUyNS02ZTRiLTQ0ODMtYTA3MS1lODU1YzIwOGE1ZjkiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImF1ZCI6ImpzLnRva2VubWFuYWdlciIsImF6cCI6ImpzLnRva2VubWFuYWdlciIsImlzcyI6Imh0dHA6XC9cLzEyNy4wLjAuMTo4MDkwIiwiZXhwIjoxNjYzNjYyMjc5LCJpYXQiOjE2NjM2NjA0Nzl9.gNNXLQJlDxGiG8tWkt-z9rqnboCuv8-978-mvLSFXF5VpZyiO9gjbGRdlMDpsTFVYu9OdV1vq-4IpGZjh08JWCt051epJ-s4rnFoSWKQajY2Qq94X2ZrCGs7yJX8oQM6MrCZ12_LOmoV216pHOxz9XxQ5O2xXuFXZkFCHbQozGxhitlXWY0y-Ivio7GCVxjaNEBP_JFACzGiU4QH2lMytpg4GUWIvlAmjMg9cuoQqoOqY43CtEQaIfCZ38Qlenx0sfXrfLnF3ci6hnRcP8pnB2aVUEr6o3xRbKWExQaDGRK9SzGpWqNRfcjQ0FNmkuSglMg5gnj4A7yTqJE-KhXQaQ",
- "token_type": "Bearer",
- "expires_in": 7199
- }
-
- 第三步:根据token获取userinfo
- http://127.0.0.1:8090/userinfo
- {
- "sub": "user",
- "email": "user@163.com",
- "email_verified": true
- }
|