How to get code value from authorize endpoint

Hi,

I’m new with Okta and Postman, so maybe the response to my question is simple but I wasn’t able to find out how to get value of code when authorize endpoint is accessed.

I set up application:

  • Sign in method: ‘OIDC - OpenID Connect’
  • Application type: ‘Web Application’

In Postman request ‘{{url}}/.well-known/openid-configuration’ is returning data.

When I’m trying to access authorize endpoint, in Postman, with ‘{{url}}/oauth2/v1/authorize?response_type=code&client_id={{clientId}}&scope=openid&redirect_uri={{callbackUrl}}&state=1234’, I can’t get value of ‘code’.

In documentation, Implement authorization by grant type | Okta Developer, is mentioned that ‘code’ is returned.

Is possible to get value of ‘code’ in Postman. If yes, how?

If Postman can’t be used, how can get it in node.js?

Thanks.

While not the normal way to complete this flow (since its meant to occur in a browser), there is a way to handle it all in Postman: How to get tokens for an OIDC application without a browser using curl/Postman | Okta Help Center

If you just need to get tokens to use against Okta or your own API in Postman, Postman does have the ability to help you complete the Auth Code flow (a browser will pop-up so you can log into your Okta org/IdP), see their docs here.

2 Likes

Thanks @andrea - it worked as needed.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.