I have a registered Azure app that is working in Microsoft production API. I've created a sandbox test account (according to this instruction) and I'm trying to receive an OAuth token. According to the instruction I've changed the login endpoint and result link is
https://login.windows-ppe.net/consumers/oauth2/v2.0/authorize?client_id=4abdfe32-XXXX-XXXX-XXXX-510dd884cd81&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F&response_mode=query&scope=openid%20offline_access%20https%3A%2F%2Fads.microsoft.com%2Fmsads.manage&state=12345
The problem is when I'm opening this link and trying to login with the created Sandbox account ([email protected]) it shows me unauthorized_client error:
We're unable to complete your request
unauthorized_client: The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at https://go.microsoft.com/fwlink/?linkid=2083908.
Supported account type for this application is any Azure AD and personal.
Any ideas what is wrong or what I've missed in my connection with Sanbox account (this happens with Sandbox account only)?
Initially, I too got same error when I used registered application Client ID and ran below login endpoint in browser:
As mentioned in this MS Document,
To resolve the error, make use of below login endpoint by replacing ClientID and redirect URI values to authenticate with sandbox account like this:
When I logged in with sandbox test account, I got consent screen with permissions:
After accepting the above consent, I got
codevalue in address bar successfully like this: