官方地址:https://pan.baidu.com/union
接入地址:https://pan.baidu.com/union/document/entrance#%E7%AE%80%E4%BB%8B
首先需要申请介入,然后创建应用,然后就可以获取到所需要的信息了;
1. 用户进行授权
http://openapi.baidu.com/oauth/2.0/authorize?
response_type=code
&client_id=【你的AppKey】
&redirect_uri=oob
&scope=basic,netdisk
&display=tv
&qrcode=1
&force_login=1
示例:
http://openapi.baidu.com/oauth/2.0/authorize?
response_type=code
&client_id=pFi5MK00QMowVsARS0vq6uUl6pHI40vp
&redirect_uri=oob
&scope=basic,netdisk
&display=tv
&qrcode=1
&force_login=1
需要扫码获取授权码
目前有的信息:
appId:24092476
授权码为:410db528d5616bfb3a370a4617a7933d
AppKey:pFi5MK00QMowVsARS0vq6uUl6pHI40vp
SecretKey:uQEpffGjBo23OYFC10yx96EY0D4HE1ds
SignKey:g9i5523T-Sfh7@6wmzFIwaT4fbA+MPdV
2、根据授权码获取token
https://openapi.baidu.com/oauth/2.0/token?grant_type=authorization_code
&code=【授权码】
&client_id=【appkey】
&client_secret=【SecretKey】
&redirect_uri=oob
示例
https://openapi.baidu.com/oauth/2.0/token?grant_type=authorization_code
&code=410db528d5616bfb3a370a4617a7933d
&client_id=pFi5MK00QMowVsARS0vq6uUl6pHI40vp
&client_secret=uQEpffGjBo23OYFC10yx96EY0D4HE1ds
&redirect_uri=oob
3、刷新token
https://openapi.baidu.com/oauth/2.0/token?grant_type=refresh_token
&refresh_token=122.2641a48e82355223fd52a9e33a1d4c0a.YH7pfkQ1Zfk3DLOoe9-NQg5GhgwaR2exRGaIgWp.ADqRPQ
&client_id=【appkey】
&client_secret=【SecretKey】
示例
https://openapi.baidu.com/oauth/2.0/token?grant_type=refresh_token
&refresh_token=122.2641a48e82355223fd52a9e33a1d4c0a.YH7pfkQ1Zfk3DLOoe9-NQg5GhgwaR2exRGaIgWp.ADqRPQ
&client_id=pFi5MK00QMowVsARS0vq6uUl6pHI40vp
&client_secret=uQEpffGjBo23OYFC10yx96EY0D4HE1ds
http://openapi.baidu.com/oauth/2.0/authorize?response_type=token
&client_id=pFi5MK00QMowVsARS0vq6uUl6pHI40vp
&redirect_uri=oob
&scope=basic,netdisk
&display=popup
&state=xxx