Unable to Access Protected Endpoints in Azure Web App Using OAuth 2.0 Client Credentials Grant in Postman

17 Views Asked by At

I have a web application hosted on Azure, protected with OpenID Connect authentication scheme. It has several endpoints that I can access successfully from the frontend of the project, located in the www root folder of the web app. Now, I need to access some of these endpoints from another system. Before implementing the integration in the second software, I want to verify if I can access the endpoints using the correct credentials. To do this, I'm using Postman. In Postman, I'm configuring the Authorization as OAuth 2.0 type. I have the access token URL, client ID, and client secret. The grant type is set to Client Credentials. I can successfully generate the access token, and I'm including it in the header of my request like this: "Authorization": "Bearer {access_token}". However, although Postman returns a 200 status code, I receive the HTML body of the Microsoft sign-in page instead of the expected response from the endpoint. How can I resolve this issue and successfully access the protected endpoints using OAuth 2.0 client credentials grant in Postman?

0

There are 0 best solutions below