【发布时间】:2021-05-09 05:03:44
【问题描述】:
我想从 Angular 应用程序调用 https://login.microsoftonline.com/##tenant##/oauth2/v2.0/token api 以从 http 调用获取访问令牌,并使用该令牌我想调用 https://graph.microsoft.com/v1.0/users/##UserId##/getMemberGroups API 而不使用任何 npm angular 包。
我尝试使用 http 服务,但出现以下错误
CORS 策略已阻止从源“https://xxx.co”访问“https://login.microsoftonline.com/xxxx/oauth2/v2.0/token”处的 XMLHttpRequest:无“访问权限-请求的资源上存在 Control-Allow-Origin' 标头。
还有其他方法可以调用 Graph API 获取令牌和用户获取登录用户组吗?
【问题讨论】:
-
尝试查看implicit grant flow获取访问令牌。
标签: angular azure-active-directory microsoft-graph-api adal