How to fix azure active directory unauthorized redirect

Muthukumaraswamy, Shivaram 0 Reputation points
2023-06-19T08:28:21.49+00:00

When I try to login to my application which uses azure AD (web application), I am redirected to my unauthorized page even though my login is successful. Please help me fix this. Thank you in advance. I have attached my code.

User's image

I have added the following in my appsettings alongside client secret, id and tenant.User's image

Windows for business Windows Client for IT Pros Directory services Active Directory
Microsoft Security Microsoft Entra Microsoft Entra ID
Microsoft Security Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2023-06-20T20:34:21.7966667+00:00

    Hello there,

    The OAuth2.0 spec provides guidance on how to handle errors during authentication using the error portion of the error response.

    Here's a sample error response:

    {

    "error": "invalid_scope",

    "error_description": "AADSTS70011: The provided value for the input parameter 'scope' isn't valid. The scope ***************************************** isn't valid.\r\nTrace ID: 255d1aef-8c98-452f-ac51-23d051240864\r\nCorrelation ID: fb3d2015-bc17-4bb9-bb85-30c5cf1aaaa7\r\nTimestamp: 2016-01-09 02:02:12Z",

    "error_codes": [

    70011
    

    ],

    "timestamp": "2016-01-09 02:02:12Z",

    "trace_id": "255d1aef-8c98-452f-ac51-23d051240864",

    "correlation_id": "fb3d2015-bc17-4bb9-bb85-30c5cf1aaaa7",

    "error_uri":"**************************************************"

    }

    https://learn.microsoft.com/en-us/azure/active-directory/develop/reference-error-codes

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.