Getting access token from OKTA in PKCE flow without user interaction

1.4k Views Asked by At

We have REST Web API written in .NET CORE, which are used on REACT SPA, we are using OKTA with PKCE.

For our API(s) we have end to end test cases written using postman/newman, the API(s) depend on JWT access token for finding user details.

How can I get access token from OKTA for PKCE flow without user interaction?

I followed this for getting access token but even this one throws a browser window for username/password.

https://developer.okta.com/docs/guides/implement-oauth-for-okta/request-access-token/

Is there a way I can pass username and password in the payload and get access token back?

In essence I am after a flow which lets me fetch access token using resource owner username and password on PKCE flow.

1

There are 1 best solutions below

1
On BEST ANSWER

It seems with SPA configuration it isn't possible as per OAuth specifications.

Had to create a native app with PKCE and used "Get Access Token with Resource Owner Password Credentials" API in the postman collection available on OKTA

Postman Screenshot