I\'ve a solution in Visual Studio \'TourManagement\' which contains 2 projects of .Net core. One is IDP using Identity Server 4, second project is RESTful API of TourManagement
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 :
In Authorization
Type, there is a dropdownlist, select OAuth2
:
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):
Don't enter openid/profile
as Scope since you are using Oauth2 in Postman .
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 :