How to call Identity Server 4 with Postman for login

The key point is getting access token for accessing tourmanagementapi using implicit flow in Postman for testing .

The first thing is set AllowAccessTokensViaBrowser to true in client config in GetClients function , so that you can transmit access tokens via the browser channel,:

new Client
{
.....
    AllowAccessTokensViaBrowser =true,
.....
}

On Postman side , do the following :

  1. Enter your api's URL .
  2. In Authorization Type, there is a dropdownlist, select OAuth2 :

    enter image description here

  3. After selecting it, you’ll notice a button that says Get Access Token, click on it and enter the following information (Based on your codes):

    enter image description here

    Don't enter openid/profile as Scope since you are using Oauth2 in Postman .

  4. Click on Request Token, you’ll see a new token added with the name of TokenName Finally, make sure you add the token to the header then click on Use Token. Token will available when sending request as authorization header :

    enter image description here


I wrote an entire step by step tutorial on how to make this happen, because the answers to this topic were'nt good enough for me.

What is different to the other responses, is how to get and store the bearer token automatically and use it for testing without having to do anything else. Perfect for integration testing your controller classes.

https://medium.com/@rotter.axel/automatically-sign-in-to-identity-server-4-with-postman-and-test-net-core-controller-methods-bc5d8feb199e