Error AADSTS9002313: Invalid request. Request is malformed or invalid, after migration.

Akshatha Shetty 0 Reputation points
2023-03-13T10:12:43.6033333+00:00

I have a login application for Alexa skill linking, which is working fine with AngularJS and .netCore1.0

Now I had to migrate it to latest technology React and .net6.0, in this the Account Linking is failed for some reason. I am referring same controller code as of old.

oauthcontroller.cs

Post Controller

OauthRequest, model class

{
        public string code { get; set; }
        public string grant_type { get; set; }
        public string client_id { get; set; }
        public string client_secret { get; set; }
        public string redirect_uri { get; set; }
        public string refresh_token { get; set; }
}

configuration

Settings

Controller api call is from Alexa Skill console as

AccountLinking

I am getting error as below for the second request with refresh token,

ErrorCode

Can anybody guide me to resolve this as soon as possible. Please.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JimmySalian-2011 42,511 Reputation points
    2023-03-13T10:57:26.0533333+00:00

    Hi Akshatta,

    As per MS article - the error code refers to "InvalidRequest - Request is malformed or invalid. - The issue here is because there was something wrong with the request to a certain endpoint. The suggestion to this issue is to get a fiddler trace of the error occurring and looking to see if the request is actually properly formatted or not.

    Can you provide a trace from the device and post it here for analysis?

    Btw can you check the redirect URL if the it has complete path instead of the top level page info?

    Also check this SO article with similar error and code -https://stackoverflow.com/questions/56870805/invalid-request-request-is-malformed-or-invalid-while-getting-access-token-fro

    Hope this helps.

    JS

    ==

    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    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.