使用Azure B2C调用Microsoft graph API [英] Call Microsoft graph API using Azure B2C

查看:186
本文介绍了使用Azure B2C调用Microsoft graph API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用b2c登录的访问令牌访问Microsoft Graph API. 以下是端点蔚蓝门户网站显示的内容.

I am trying to access Microsoft Graph API using Access token of b2c login. Following are the endpoints azure portal showing.

据我所知,我们必须能够根据以下方法调用 https://graph.microsoft.com 终结点这.如果我错了,请纠正我.然后,我按如下所示生成访问令牌,并尝试调用 https://graph.microsoft.com/v1.0/me/使用该令牌.

As I feel we must be able to call https://graph.microsoft.com endpoints according to this. Please correct me if I am wrong. Then I generated access token as follows and Tried to call https://graph.microsoft.com/v1.0/me/ using that token.

结果如下.

{
  "error": {
    "code": "InvalidAuthenticationToken",
    "message": "Access token validation failure.",
    "innerError": {
      "date": "2020-08-25T11:58:07",
      "request-id": "c6a9ba06-d41e-49f7-ba94-f75478ce89b0"
    }
  }
}

我也已在我的应用程序中授予了如下API权限

I have granted API permissions as follows in my application too

推荐答案

这将无法正常工作.在您的AAD B2C租户中使用Azure AD流.

This wont work. Use the Azure AD flows in your AAD B2C tenant.

https://docs.microsoft.com/en-us/graph/auth-v2-service

这篇关于使用Azure B2C调用Microsoft graph API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆