I am using OpenID Connect and I need to request user email. I have created and AAD app and enabled all possible scopes/permissions (just for testing).
However, whenever I request the scopes "openid email" and the user gives the consent, I always get an access_denied error. Could anyone shed some light on why this is happening?
My request:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
?client_id=2c4a8f6b-0cde-4134-aaa5-dc6552704576
&scope=openid%20email
&response_type=code
&redirect_uri=https<myuri>
&state=<mystate>
When the user gives the consent, I get the following response with code 302:
https:<my callback uri>?code=<VALID code is here>
However, there redirect location is
https://<my uri>/callback?error=access_denied