1

Whenever i connect Azure platform from my platform & access for Authorization getting an error like the following

Authorization failed with the error message, 'AADSTS900144: The request body must contain the following parameter: 'code'. Trace ID: 0c2a6ce5-a127-491f-8ef5-34b4b0f11a00 Correlation ID: 5ae207ac-ff51-43da-92a6-0225372c55b1 Timestamp: 2020-10-06 11:19:33Z'

Similarly faced scope value exception.Refered the link AADSTS900144: The request body must contain the following parameter: 'scope' when using legacy Developer Portal

Now, How to fetch the code value Azure platform?

Gayathri S
  • 11
  • 3
  • Did you add `code` and `scope` to the request body? – Carl Zhao Oct 08 '20 at 09:00
  • If my answer is helpful for you, you can accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). This can be beneficial to other community members. Thank you – Carl Zhao Oct 08 '20 at 10:16

2 Answers2

1

Code will be provided in the response of the authorization request. Once obtained you will include it in the token request as detailed in Request an access token.

AlfredoRevilla-MSFT
  • 3,171
  • 1
  • 12
  • 18
1

According to your error message, you are missing request parameters when requesting an access token. You need to put the following parameters in the request body

enter image description here

For code, it needs to be acquired by interactive login users, you need to execute the following request in the browser to acquire it:

https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&response_type=code
&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F
&response_mode=query
&scope=openid%20offline_access%20https%3A%2F%2Fgraph.microsoft.com%2Fmail.read
&state=12345

enter image description here

Carl Zhao
  • 8,543
  • 2
  • 11
  • 19