How to obtain access token for a public application

Hi guys,

It might sound weird that I will process request with API endpoints but I don’t have client ID.
I want to develop a public application for internal usage only and users can SSO into the applications after they successfully log into OKTA with MFA. I referred to Request Example for Primary Authentication with Public Applications and implement login code through API endpoint “api/v1/authn” in python. However, when I want to obtain the list of applications, I always get error “401: Unauthorized”.
I found there is an access token instead SSWS token used when I logged into my org’s from okta web site. Please advice how to prepare request for authorize server token granting. Thanks in advance.
Flik

Hello, @flik,
Thank you for reaching out here on the Okta Developer Forum. For this specific scenario, we have two parts.

  1. Authentication and authorization for the user. (SSO using Okta)
  2. Authorization for the API request. (to list all applications)

For the first part, please check this support article.
And also the following documentation: Implement authorization by grant type | Okta Developer

For the second part, you can use an API token to authorize the API request.
Or you can use a different approach ( to request a new access token from a service application), as documented here: Implement OAuth for Okta with a service app | Okta Developer

Hi @cosmin.i,
Many thanks for your clear explanation of requisitions for my specific scenario.
However, I am not the admin of my org and I could not create OKTA app integration for my app. Indeed my app just automates bunches of manual operations and I use python and I am not going to adapt any framework like Flask to setup a callback endpoint to receive any code.
I wonder whether PKCE flow can work for me. Base on my understanding, I login OKTA successfully and I have been granted proper permissions. It should be possible for me to navigate to any URL to simulate the users’ SSO operation. Please advice.
Thanks and best regards,
Flik

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