最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

azure - Getting error while creating access token using OAuth 2.0 for MS Fabric - Stack Overflow

programmeradmin4浏览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 .0/token

Under Authorization: I selected Oauth2.0

Configure New Token Token Name: test

Grant type: Authorization Code

Callback URL: http://localhost

Auth URL: .0/authorize

Access Token URL: .0/token

Client ID: *** Client Secret: *** Scope: /.default

Refresh Token URL .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": "; }

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

Screenshot

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/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/Tenant-ID/oauth2/v2.0/authorize

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

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

Refresh Token URL https://login.microsoftonline/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/error?code=900144" }

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

Screenshot

Share Improve this question edited 10 hours ago VLAZ 29.1k9 gold badges62 silver badges84 bronze badges asked 21 hours ago SalmanSalman 1,8676 gold badges15 silver badges28 bronze badges 7
  • 1 Can you also paste screenshot of Postman? – Rukmini Commented 21 hours ago
  • How did you configure redirect URL in application? – Rukmini Commented 21 hours ago
  • check this stackoverflow/questions/77187333/… – Rukmini Commented 21 hours ago
  • 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 – Rukmini Commented 20 hours ago
  • Tried it, Got error POST login.microsoftonline**/oauth2/v2.0/token%0A 400 576 ms Error: Could not complete OAuth 2.0 token request – Salman Commented 20 hours ago
 |  Show 2 more comments

1 Answer 1

Reset to default 0

I am using Postman web version to generate the access token

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

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/TenantID/oauth2/v2.0/authorize
Access Token URL : https://login.microsoftonline/TenantID/oauth2/v2.0/token
ClientID : ClientID
Client Secret : ***
Scope : https://api.fabric.microsoft/.default openid offline_access

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

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

I got tokens successfully:

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.

发布评论

评论列表(0)

  1. 暂无评论