2

I'm trying to login to an Azure AD B2C app using the example here: https://github.com/nordvall/TokenClient/wiki/OAuth-2-Resource-Owner-Password-Credentials-grant-in-AzureAd

Configured like so:

url: https://login.microsoftonline.com/[myapp].onmicrosoft.com/oauth2/token?api-version=1.6

Passing in the Azure AD B2C applications application id for client_id but I'm actually not sure what to pass in for the resource. I'm trying to get an access token for some azure functions but the azure functions app doesn't seem to have any specific 'resource id' I can define anywhere..

When I make the post request I get the following:

{
    "error": "invalid_request",
    "error_description": "AADSTS90002: Tenant not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator.\r\nTrace ID: x\r\nCorrelation ID: x\r\nTimestamp: 2018-02-19 10:54:20Z",
    "error_codes": [
        90002
    ],
    "timestamp": "2018-02-19 10:54:20Z",
    "trace_id": "x",
    "correlation_id": "x"
}
meds
  • 21,699
  • 37
  • 163
  • 314

1 Answers1

0

The guide you referenced is for Azure AD, not B2C, unfortunately.

Azure AD B2C doesn't currently support Resource Owner Grant Flow, see this SO post. UserVoice request for this.

This documentation might help: Azure Active Directory B2C: Types of applications. More specifically: Daemons/server-side apps.

These apps can get tokens only after an interactive user flow has occurred.

spottedmahn
  • 14,823
  • 13
  • 108
  • 178