注册应用:
https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade
API接口登录
文档:https://learn.microsoft.com/zh-cn/onedrive/developer/rest-api/getting-started/graph-oauth?view=odsp-graph-online
开启多租户
报错如下的话,开启这个多租户
AADSTS50194: Application '23ae37f3-548d-44dc-9ad1-f7c4cd75636b'(test) is not configured as a multi-tenant application. Usage of the /common endpoint is not supported for such applications created after '10/15/2018'. Use a tenant-specific endpoint or configure the application to be multi-tenant.
构造URL,令牌流
报错: AADSTS700051: response_type 'token' is not enabled for the application.
需要开启令牌
重定向URL必须和上图配置的一样才行
构造授权URL后,重定向的URL为如下所示
https://demo-dev.shuxiaoyuan.com/test/onedrive/redirectUri#access_token=eyJ0xxxxtSSJ9.exxx.UxxxLJg&token_type=Bearer&expires_in=4129&scope=Files.Read.All+profile+openid+email&session_state=d5bd8ebf-865d-4e71-85bf-7128319006d8
构造URL,代码流
如果报这个错的话,给应用开启一个回调地址即可
token流必须要开启这个