1. Boot the user who needs authorization to the following address:
Url
1 |
https://api.weibo.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=YOUR_REGISTERED_REDIRECT_URI |
2. If the user agrees to authorize, the page jumps to Your_registered_redirect_uri/?code=code
3. In exchange for access Token
Url
1 |
https://api.weibo.com/oauth2/access_token?client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=authorization_code&redirect_uri=YOUR_REGISTERED_REDIRECT_URI&code=CODE |
Where Client_id=your_client_id&client_secret=your_client_secret can be added to the header using the basic method, the return value
Json
12345 |
{ "access_token" : "SlAV32hkKG" , "remind_in" : 3600, "expires_in" : 3600 } |
4. Invoking the API using the obtained access token
OAuth2.0 Learning (5-2) Sina open platform-licensing of Weibo Api-web website