Verification of Okta token in Python
07:50 13 Apr 2021

I would like to verify an Okta token (RS256) in python. I have tried to find the solution online but have not managed to get it to work:

I have tried this so far:

from py_jwt_validator import PyJwtValidator, PyJwtException
jwt = OKTA_TOKEN
try:
    PyJwtValidator(jwt)
except PyJwtException as e:
    print(f"Exception caught. Error: {e}")

throwing the error: Okta-Specific: Access Tokens can not be validated locally without a Custom Authorization Server.

I have also tried to use the okta endpoint /introspect, but I keep on getting Response 405. I try to do get request to introspect/client_id=CLIENT_ID&token_type_hint=access_token&token=TOKEN

I also tried several other packages including okta_jwt (complains about ErrorKey : "jwks_uri")...

python jwt okta