I followed your Flask sample application for a new Python API and it worked beautifully. However, I wanted to be able to use Connexion which generates the boilerplate code from a swagger.yml and I simply define the methods for each endpoint. I tried using the @oidc.accept_token before the endpoint methods, however, the Connexion code that loads the endpoint module must not do something as expected as I get “TypeError: init() missing 1 required positional argument: ‘import_name’” when trying to call OpenIDConnect to get the oidc object.
I have access to the headers in the endpoint methods, so I could work with the bearer token inside the methods.
So my question is: is there an alternative to the @oidc.accept_token strategy defined in the Okta Python library that I could use, or perhaps something simple that I can do to get the oidc object and be able to use the accept_token as demonstrated in your example file?
You can find my code at GitHub here: https://github.com/rkamradt/flaskapi
The main.py is the main module and the winePairing.py is the endpoint methods.