POST call to /common/oauth2/token returns 400, reason=Bad Request

o365-38 Oracle 0 Reputation points
2023-01-13T22:20:16.4266667+00:00

Netty Request - DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)

POST /common/oauth2/token HTTP/1.1

Accept: /

x-span-id: xxxxxxx

Content-Length: 983

Content-Type: application/x-www-form-urlencoded

User-Agent: Jersey/2.34 (Netty 4.1.x)

host: login.microsoftonline.com

refresh_token=<value>&grant_type=refresh_token&client_secret=<secret>&client_id=<clientID>

HTTP/1.1 400 Bad Request

Cache-Control: no-store, no-cache

Pragma: no-cache

Content-Type: application/json; charset=utf-8

Expires: -1

Strict-Transport-Security: max-age=31536000; includeSubDomains

X-Content-Type-Options: nosniff

P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"

x-ms-request-id: 93647af4-3b08-4afc-beaf-6c0eb1701e00

Where can I find the logs to determine the cause for "Bad Request". Same content works fine with curl.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. HarmeetSingh7172 4,826 Reputation points
    2023-01-13T22:55:31.4733333+00:00

    Hello @o365-38 Oracle

    For this kind of issue, you could use a Tool like Fiddler to find the inner error message in the response. Please refer this Fiddler documentation and this Graph API Authentication & Authorization documentation.

    However, I would suggest you raise a support case with Microsoft Graph, a Support Engineer will be able to assist you better. You can raise support ticket from http://aad.portal.azure.com/ or https://admin.microsoft.com/#/support/requests.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    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.