Janith Widarshana
Janith Widarshana

Reputation: 3483

Call Microsoft graph API using Azure B2C

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

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.

enter image description here

The result is as follows.

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

I have granted API permissions as follows in my application too enter image description here

Upvotes: 2

Views: 2083

Answers (1)

Jas Suri - MSFT
Jas Suri - MSFT

Reputation: 11335

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

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

Upvotes: 2

Related Questions