Azure-Samples / ms-identity-python-webapp

A Python web application calling Microsoft graph that is secured using the Microsoft identity platform
MIT License
291 stars 138 forks source link

Not getting access token using B2C. #10

Closed aarsan closed 4 years ago

aarsan commented 4 years ago

When trying to make a graph call to the /me endpoint, I am not getting an access token. I do get an id token, however.

rayluo commented 4 years ago

Admittedly, our README_B2C only mentions how to get an access token for an web api hosted inside your B2C tenant, but we did not try the MS graph. What is your configuration setting for the SCOPE?

I'm also looping in PM @negoe who might be more familiar in this particular usage.

aarsan commented 4 years ago

I've tried various scopes with different failures but the one I'm trying now is: 'https://graph.microsoft.com/.default'

rayluo commented 4 years ago

It turns out a B2C app is not currently able to access MS graph api. MS Graph is an AAD resource, not a B2C resource.

Since last year, the B2C team is working to combine the AAD and B2C, but it takes time. When that happens, this sample would be able to acquire the token.

PS: Thanks @jennyf19 for confirming this, while in her business trip in the other side of the earth!