Python support feedback

Right now, our support for applications built in Python is limited. Okta works with any middleware or framework that supports OpenID Connect, but we have limited support for integrating with Python web frameworks or making API calls from Python code easy.

We’re currently investigating building more libraries for Python. If you’re interested in any of these features, please reply to this thread and let us know:

  • Call the Okta management APIs from Python code (Users API, Groups API, etc)
  • Interact with the Authentication API from Python code
  • Samples for adding Okta and OpenID Connect to Django or Flask

I’ve got a mini library written in python interacting with the API to script certain things. It’d be nice to have a library of functions to call written by an actual developer and not an engineer pretending to be one. :wink:

1 Like

I am interested in exploring using Okta within a python flask application.
Just need a basic user credentials, easy account creation, etc that works across cloud providers.
Sample python code for flask would be great.


We are also interested in python flask esamples.

Python/Flask support is crucial for my company. Samples would help us to integrate faster and more secure. It’s not a problem to call APIs, just how to make sure that everything is OK if we’re not experts on SSO?

@wombat @drinky Thanks for your feedback. I’m curious: what types of applications are you building? Customer-facing applications, apps for the Okta dashboard, or something else?

Ours is a customer facing product. At this point, it seems Firebase meets our needs.

We also need Python/Flask support, we are building internal Flask based RESTful APIs, it would be great that we can easily integrate them with Okta.

@nate.barbettini We use the ‘legacy’ Python SDK to provision new users from our Google Cloud based application that’s integrated with Okta through OpenID/Connect.

Instead having our support people add people in Okta, we do this through our UI and provision the users in Okta using the Python API, same as triggering an activation email.

We’re about to implement JIT user creation for customers that want to use their own Identity Provider through SAML, and will pull user information out of Okta, again using the Python API to figure out what do on our application end.

So basically our Python API need is to lookup create, update and delete users in Okta. Having a supported API is preferred, but the existing Python okta API has worked for years now without problems so we currently don’t see a need to make changes.

On this legacy note: do you expect Okta to make changes on the Okta side that will break the legacy API in the future? This would be bad, but I guess we’d catch these problems in our sandbox first…

1 Like

Looking to integrate with Okta in a django project - any samples for any of this would be great!

1 Like

I’m interested in all three of those items (samples for Flask over Django, in my case). My employer is evaluating Okta as an SSO solution. I build internal tools (generally Flask-based web apps) and would like to be able to use Okta to control access to the app as well as permit specific types of capabilities in the app, depending on okta group membership, etc. One of my immediate goals would be to be able to match up an Okta login with a gitlab account, so that I can make changes to the logged in user’s gitlab account. (I already have full access to all accounts via gitlab’s python api, but I would like to be able to restrict operations to the logged in user’s projects, or specific gitlab groups they belong to.) Thanks!

1 Like

While we don’t yet have a full Python integration library, this new blog post by @rdegges shows how to use flask-oidc to connect a Flask application to Okta:

@nate.barbettini Is there limited functionality to create an application via Okta API from python code?

We create customer facing web as well as mobile app on OKTA and we want to automate the whole process. For that, I tried to create an app calling Okta APIs from python code but getting errors. Below is a link to the errors/issues I am facing.

Any help is appreciated.

We now have an official sample for Python+Flask:

I’d love to hear if it is useful (or not). Feel free to leave feedback here or create a new post on the forum.

Hi Nate,

One data point: we’ve just started an Okta trial, and the Flask example is proving very helpful for testing OIDC and giving us an idea of what will be required to integrate our apps.

Django samples would be absolutely awesome as most of our internal apps are Django, if you could please add this to your roadmap.


1 Like

Hi Nate,
I would like to join the request of Django samples.

Aiohttp or as a last resort Twisted - anything async, please. Authentication and OpenID Connect.

Another vote for Django samples.

Sample code for building integrations with Okta is welcome, but not really necessary provided that there’s some toolkit for building OAuth, OIDC, SAML, etc service providers in Python. Basically, OneLogin can cover your behind on this. :wink:

I need your management API. I need to automate administration of users, groups, and applications (among probably other things, but let’s start with the obvious). And I need to do it in Python. The only people who are going to build this are Okta and your users. I’d rather use Okta official code.

Please put some effort on that foremost, rather than authnz client libraries for well-defined public protocols.


I was successfully using this example back in November 2018 but tried dusting it off again today and it’s throwing okta.framework.OktaError.OktaError: Invalid token provided when calling g.user = okta_client.get_user(oidc.user_getfield("sub"))