—— ZHAO Jinxiang
RFC 6749 - The OAuth 2.0 Authorization Framework - IETF Tools
+--------+ +---------------+
| |--(A)- Authorization Request ->| Resource |
| | | Owner |
| |<-(B)-- Authorization Grant ---| |
| | +---------------+
| |
| | +---------------+
| |--(C)-- Authorization Grant -->| Authorization |
| Client | | Server |
| |<-(D)----- Access Token -------| |
| | +---------------+
| |
| | +---------------+
| |--(E)----- Access Token ------>| Resource |
| | | Server |
| |<-(F)--- Protected Resource ---| |
+--------+ +---------------+
+----------+
| Resource |
| Owner |
| |
+----------+
v
| Resource Owner
(A) Password Credentials
|
v
+---------+ +---------------+
| |>--(B)---- Resource Owner ------->| |
| | Password Credentials | Authorization |
| Client | | Server |
| |<--(C)---- Access Token ---------<| |
| | (w/ Optional Refresh Token) | |
+---------+ +---------------+
await fetch('https://ant-design-pro-next.netlify.com/.netlify/functions/authorize',{
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "username=username@qq.com&password=username@qq.com&grant_type=password"
}).then(x=>x.json())
await fetch('https://ant-design-pro-next.netlify.com/.netlify/functions/authorize',{
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "grant_type=refresh_token&refresh_token="+
"eyJ1c2VybmFtZSI6InVzZXJuYW1lQHFxLmNvbSIsInBhc3N3b3JkIjoidXNlcm5hbWVAcXEuY29tIn0="
}).then(x=>x.json())
RFC 7515 - JSON Web Signature (JWS) - IETF Tools