How to set up PostMan authentication to an Itendity server 4 Identity server. Have you been trying to test your API with authentication? Are you using Identityserver4?
Client
The following client Will allow you to connect using Postman. Note that the grant type needs to be authorization_code and that you will need a redirectURI of https://www.getpostman.com/oauth2/callback.
{
"client": {
"allowOfflineAccess": true,
"allowedScopes": [
"openid",
"profile",
"testapi"
],
"logoutUri": null,
"redirectUris": [
"https://www.getpostman.com/oauth2/callback"
],
"enabled": true,
"clientId": "832afa32-cabe-40a0-8909-2241cd85e47d.Local.apps",
"clientSecrets": [
"NotASecret"
],
"clientName": "PostMan Login",
"postLogoutRedirectUris": [
"http://localhost:5002/signout-callback-oidc"
],
"clientUri": null,
"allowedGrantTypes": [
"authorization_code"
],
"allowAccessTokensViaBrowser": true,
"logoUri": null
}
}
Postman settings
In postman on the Authorization tab select type of Oauth 2.0. Then you can set up postman authentication as so.
Conclusion
Using postman to test your API calls is quite easy even if you need authentication in order to access the api endpoint.
That was incredibly helpful, thanks you! Saved me a ton of time configuring the Client in Identity Server.