0

In Postman I am trying to generate Access token using Oauth2.0 for MS fabric Update API call.

I have entered below details

POST https://login.microsoftonline.com/tenant-ID/oauth2/v2.0/token

Under Authorization: I selected Oauth2.0

Configure New Token Token Name: test

Grant type: Authorization Code

Callback URL: http://localhost

Auth URL: https://login.microsoftonline.com/Tenant-ID/oauth2/v2.0/authorize

Access Token URL: https://login.microsoftonline.com/Tenant-ID/oauth2/v2.0/token

Client ID: *** Client Secret: *** Scope: https://api.fabric.microsoft.com/.default

Refresh Token URL https://login.microsoftonline.com/Tenant-ID/oauth2/v2.0/token

In Azure AD App Registration I have set- Web Redirect URI: http://localhost

When I click "Get New Access Token" I get error as below

"error": "invalid_request", "error_description": "AADSTS900144: The request body must contain the following parameter: 'grant_type'. Trace ID: ** Correlation ID: ** Timestamp: 2025-02-19 07:33:46Z", "error_codes": [ 900144 ], "error_uri": "https://login.microsoftonline.com/error?code=900144" }

GET https://login.microsoftonline.com/**/oauth2/v2.0/authorize?response_type=code&client_id=3**ac&scope=https%3A%2F%2Fapi.fabric.microsoft.com%2F.default&redirect_uri=http%3A%2F%2Flocalhost 302 POST https://login.microsoftonline.com/**/oauth2/v2.0/token%0A 400 559 ms Error: Could not complete OAuth 2.0 token request

Screenshot enter image description here

7
  • 1
    Can you also paste screenshot of Postman? Commented Feb 19 at 7:48
  • How did you configure redirect URL in application? Commented Feb 19 at 7:52
  • check this stackoverflow.com/questions/77187333/… Commented Feb 19 at 8:03
  • 1
    Configure redirect URL under WEB as https://oauth.pstmn.io/v1/callback and check click on browser in postman and allow the pop-up in browser Commented Feb 19 at 8:14
  • Tried it, Got error POST login.microsoftonline.com**/oauth2/v2.0/token%0A 400 576 ms Error: Could not complete OAuth 2.0 token request Commented Feb 19 at 8:32

1 Answer 1

1

I am using Postman web version to generate the access token

Created a Microsoft Entra ID application and configured redirect URI as WEB:

enter image description here

As I am using Postman web version, I configured redirect URI as https://oauth.pstmn.io/v1/browser-callback. If you are making use of Postman app then configure it as https://oauth.pstmn.io/v1/callback

Now I generated the tokens, selecting OAuth 2.0 under Authorization:

Token Name: test
Grant type : Authorization Code

Callback URL : RedirectURL
Auth URL : https://login.microsoftonline.com/TenantID/oauth2/v2.0/authorize
Access Token URL : https://login.microsoftonline.com/TenantID/oauth2/v2.0/token
ClientID : ClientID
Client Secret : ***
Scope : https://api.fabric.microsoft.com/.default openid offline_access

Refresh Token URL : https://login.microsoftonline.com/TenantID/oauth2/v2.0/token

enter image description here When I clicked on Get New Access Token, I got the sign-in screen:

enter image description here

I got tokens successfully:

enter image description here

enter image description here

enter image description here

In the screenshot you have added, I can see you have pasted the token URL in the POST. Try to remove and check.

If still the issue persists, open a new request and configure the new token request.

Sign up to request clarification or add additional context in comments.

3 Comments

Yes this worked nicely, the desktop app was giving issues for some reason
I dont have idea on deployment. Other community members will help you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.