Share via

AADSTS9002313: Invalid request. Request is malformed or invalid.

Anonymous
2020-02-29T05:16:45+00:00

Im trying to get access token for o365 account using the api's and i'm always getting an and invalid request.

{

    "error": "invalid_grant",

    "error_description": "AADSTS9002313: Invalid request. Request is malformed or invalid.\r\nTrace ID: 02c6741b-9d15-434a-81d0-dcf8901b3f00\r\nCorrelation ID: f36b6aa8-a00b-4ddc-8d70-20a5f447ba9f\r\nTimestamp: 2020-02-29 05:10:05Z",

    "error_codes": [

        9002313

    ],

    "timestamp": "2020-02-29 05:10:05Z",

    "trace_id": "02c6741b-9d15-434a-81d0-dcf8901b3f00",

    "correlation_id": "f36b6aa8-a00b-4ddc-8d70-20a5f447ba9f",

    "error_uri": "https://login.microsoftonline.com/error?code=9002313"

}

1- generated authorization code using the following url.

https://login.microsoftonline.com/8d753e8b-3fdc-4332-84f1-aaf34d63865f/oauth2/v2.0/authorize?client\_id=0d0e1bb5-ca4f-4b3e-826f-96d568f63fcd&response\_type=code&redirect\_uri=https://www.google.com&response\_mode=query&scope=Calendars.ReadWrite offline_access Calendars.ReadWrite.Shared User.ReadBasic.All&state=12345

2- then used post man to generate access token, and always get an error stating invalid request

https://login.microsoftonline.com/common/oauth2/v2.0/token

client_id=0d0e1bb5-ca4f-4b3e-826f-96d568f63fcd

&grant_type=refresh_token

&client_secret=zhtedOQP@$_dxIHFO27918+

&redirect_uri=https://www.google.com

&refresh_token=OAQABAAIAAABeAFzDwllzTYGDLh_qYbH8Z2fmkytj9Ew_cRKvzq5IT5Oj_M0u_Cx_dMfqWR8Pjq5em4_kqnhhURihnREOTkET_Sj2nuvVRgyaXG_hCO1coyHGG0sP9J5anHZGGPFkkd21EOuCMtvpIzZ1c6-DxV0kQtpjaf1bRx7t8FY91TXVDK363-fAxzUxv2650FtdYQk2-YMu1DNKLUfaQ1cTf1kEalJFE_DA_15HtlH6crRqQMETKG6bKFR_YGN8X6-g2ZR6pVXn5OgaRIT0TYlsyBIiafL_pwjVoitr_NlVAXp0Iszjn6g2sPnGcWScr-p9VleMrw2kwUW6j2T7zKrzdJow1h_dSXpxH8Q8Sr_nnaplIutgD_EwdCmrR9pinrT12XJFfrqGjZ3RKIBqPGbAzO9DPZhW1c2fYhy-dLlrqcf1hiCIR4g1mMcB1d5FM5F964BP5ho_-ZhrYDcHqEdPhFDW8Gl1vwLvnqOUGWG9B-g8MQ781lwcBaiqAgiP4Ku9g-JFkouURSSztGKlbPOH3Nn9PyT90LGdxlJXNdES0E6s80ppfrR0t0OzIwsU6-Y43rfTxCDSzP2nUK3882-0P-wJ9rS4Slp5rDq2dsO6yFcA4WQAQMFpHtJpPoR4LrfIgxrOwVci8DSwoerT2UVdPgrGPlmqEcNp_MiuW50yrVWMngDTUQnBhglXQ9TizCv8vd8gAA

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2020-04-24T18:59:21+00:00

    Im trying to get access token for o365 account using the api's and i'm always getting an and invalid request.

    {

        "error": "invalid_grant",

        "error_description": "AADSTS9002313: Invalid request. Request is malformed or invalid.\r\nTrace ID: 02c6741b-9d15-434a-81d0-dcf8901b3f00\r\nCorrelation ID: f36b6aa8-a00b-4ddc-8d70-20a5f447ba9f\r\nTimestamp: 2020-02-29 05:10:05Z",

        "error_codes": [

            9002313

        ],

        "timestamp": "2020-02-29 05:10:05Z",

        "trace_id": "02c6741b-9d15-434a-81d0-dcf8901b3f00",

        "correlation_id": "f36b6aa8-a00b-4ddc-8d70-20a5f447ba9f",

        "error_uri": "https://login.microsoftonline.com/error?code=9002313"

    }

    1- generated authorization code using the following url.

    https://login.microsoftonline.com/8d753e8b-3fdc-4332-84f1-aaf34d63865f/oauth2/v2.0/authorize?client\_id=0d0e1bb5-ca4f-4b3e-826f-96d568f63fcd&response\_type=code&redirect\_uri=https://www.google.com&response\_mode=query&scope=Calendars.ReadWrite offline_access Calendars.ReadWrite.Shared User.ReadBasic.All&state=12345

    2- then used post man to generate access token, and always get an error stating invalid request

    https://login.microsoftonline.com/common/oauth2/v2.0/token

    client_id=0d0e1bb5-ca4f-4b3e-826f-96d568f63fcd

    &grant_type=refresh_token

    &client_secret=zhtedOQP@$_dxIHFO27918+

    &redirect_uri=https://www.google.com

    &refresh_token=OAQABAAIAAABeAFzDwllzTYGDLh_qYbH8Z2fmkytj9Ew_cRKvzq5IT5Oj_M0u_Cx_dMfqWR8Pjq5em4_kqnhhURihnREOTkET_Sj2nuvVRgyaXG_hCO1coyHGG0sP9J5anHZGGPFkkd21EOuCMtvpIzZ1c6-DxV0kQtpjaf1bRx7t8FY91TXVDK363-fAxzUxv2650FtdYQk2-YMu1DNKLUfaQ1cTf1kEalJFE_DA_15HtlH6crRqQMETKG6bKFR_YGN8X6-g2ZR6pVXn5OgaRIT0TYlsyBIiafL_pwjVoitr_NlVAXp0Iszjn6g2sPnGcWScr-p9VleMrw2kwUW6j2T7zKrzdJow1h_dSXpxH8Q8Sr_nnaplIutgD_EwdCmrR9pinrT12XJFfrqGjZ3RKIBqPGbAzO9DPZhW1c2fYhy-dLlrqcf1hiCIR4g1mMcB1d5FM5F964BP5ho_-ZhrYDcHqEdPhFDW8Gl1vwLvnqOUGWG9B-g8MQ781lwcBaiqAgiP4Ku9g-JFkouURSSztGKlbPOH3Nn9PyT90LGdxlJXNdES0E6s80ppfrR0t0OzIwsU6-Y43rfTxCDSzP2nUK3882-0P-wJ9rS4Slp5rDq2dsO6yFcA4WQAQMFpHtJpPoR4LrfIgxrOwVci8DSwoerT2UVdPgrGPlmqEcNp_MiuW50yrVWMngDTUQnBhglXQ9TizCv8vd8gAA

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-02-29T09:21:52+00:00

    Hi Helium Automation Admin,

    Thank you for the posting in forum community.

    Based on this error message, this issue may be related to the AAD connect. May I know if you can sign in other applications like Outlook Web App(OWA)? If the issue is related to the subscription environment, you will not be able to sign in OWA too. It cannot get the correct token so it failed to sign in. If you are using some special environment, please let me know the detailed information and the authentication methods, If any.

    If you are not using some special environment, you can try to sign in use another browser or InPrivate mode/ Incognito mode.

    Also, kindly try to sign in to Office 365 account from different PC, try to identify that if the issue still persist.

    If it still fails, please check if all the users in your organization have the same issue.

    Further, kindly provide us detailed screenshot about "AADSTS9002313: Invalid request. Request is malformed or invalid" for further assistant.

    We are truly appreciating your cooperation in our forum community.

    Regards,

    Darpan

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-03-02T22:11:49+00:00

    Hi Helium Automation Admin,

    Let us feel free to contact us and provide us some detailed updated information from your side so we can further assist you accordingly.

    Regards,

    Darpan

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments