Sign in user through api and get access token without redirect

hi, im trying to authenticate my users using an enpoint:
{{url}}/api/v1/authn setting up username and password,
but this this i only get session_token,
how can i have the access_token only using endpoint without any redirection,
im trying to create validate my endpoints using okta users but without having any UI view, just only endponts,

how can i work on this, im using node js express.

Thank You in advance!

Hello,
The /authn API is only for authentication against an Okta Org, this endpoint does not mint tokens.

In order to get an access token you will need to use the session_token an make an /authorize call. Note usually this call happens through a browser user-agent. None of the Okta SDKs support making this call without a browser agent except for the mobile SDKs.

Below is a sample of doing the entire flow from a Node CLI application, but is for demonstration purposes and not a supported flow.

1 Like