{"library":"okta-jwt-verifier","title":"Okta JWT Verifier for Python","description":"A Python library for validating JWT access and ID tokens issued by Okta. It simplifies the process of verifying token signatures, expiration, issuer, and audience, ensuring secure API access in Python applications. The current version is 0.4.0. Release cadence is typically moderate, with updates primarily for dependency bumps, security fixes, or minor feature enhancements.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install okta-jwt-verifier"],"cli":null},"imports":["from okta_jwt_verifier import JwtVerifier","from okta_jwt_verifier.exceptions import InvalidTokenException"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport asyncio\nfrom okta_jwt_verifier import JwtVerifier\nfrom okta_jwt_verifier.exceptions import InvalidTokenException, MissingIssuerException, MissingAudienceException\n\n# --- Configuration (replace with your actual Okta values) ---\n# Your Okta Org URL, e.g., 'https://dev-12345678.okta.com'\nOKTA_ORG_URL = os.environ.get('OKTA_ORG_URL', 'https://dev-12345678.okta.com')\n# The audience identifier for your API, e.g., 'api://default' or a specific Client ID\nOKTA_AUDIENCE = os.environ.get('OKTA_AUDIENCE', 'api://default')\n\n# An example JWT token. FOR SUCCESSFUL VERIFICATION, replace this with a real Okta Access Token.\n# This placeholder token is designed to match the default issuer/audience but will have an invalid signature.\nEXAMPLE_JWT_TOKEN = os.environ.get('EXAMPLE_JWT_TOKEN', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjQ4MjE5MzkyMDAsImF1ZCI6ImFwaTovL2RlZmFhdWx0IiwiaXNzIjoiaHR0cHM6Ly9kZXYtMTIzNDU2NzguT2t0YS5jb20ifQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c')\n\nasync def verify_token_example():\n    if 'dev-12345678.okta.com' in OKTA_ORG_URL or OKTA_AUDIENCE == 'api://default':\n        print(\"WARNING: Using placeholder values. For successful verification, set real OKTA_ORG_URL and OKTA_AUDIENCE environment variables.\")\n    if EXAMPLE_JWT_TOKEN == 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjQ4MjE5MzkyMDAsImF1ZCI6ImFwaTovL2RlZmFhdWx0IiwiaXNzIjoiaHR0cHM6Ly9kZXYtMTIzNDU2NzguT2t0YS5jb20ifQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c':\n        print(\"WARNING: Using a dummy JWT token. Verification will likely fail with 'Invalid signature' or similar errors. Set EXAMPLE_JWT_TOKEN environment variable.\")\n    \n    print(f\"\\nAttempting to verify token with:\\n  Issuer: {OKTA_ORG_URL}\\n  Audience: {OKTA_AUDIENCE}\")\n\n    try:\n        # Initialize the verifier with your Okta issuer and expected audience\n        jwt_verifier = JwtVerifier(\n            issuer=OKTA_ORG_URL,\n            audience=OKTA_AUDIENCE\n        )\n\n        # Use verify_access_token for access tokens or verify_id_token for ID tokens\n        verified_claims = await jwt_verifier.verify_access_token(EXAMPLE_JWT_TOKEN)\n\n        print(\"\\nJWT Token successfully verified!\")\n        print(f\"Claims: {verified_claims}\")\n\n    except (InvalidTokenException, MissingIssuerException, MissingAudienceException) as e:\n        print(f\"\\nJWT Token verification failed: {e}\")\n        print(\"Please ensure your OKTA_ORG_URL, OKTA_AUDIENCE, and EXAMPLE_JWT_TOKEN are correctly configured and valid.\")\n    except Exception as e:\n        print(f\"\\nAn unexpected error occurred during verification: {e}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(verify_token_example())\n","lang":"python","description":"This quickstart demonstrates how to initialize the `JwtVerifier` and verify an Okta Access Token. Remember to replace the placeholder environment variables (or directly set the values) with your actual Okta Org URL, API Audience, and a real JWT token for successful verification. The `verify_access_token` method is asynchronous and must be awaited.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.5.0","pypi_latest":"0.5.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4.1,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"27.7M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":4.8,"import_time_s":null,"mem_mb":null,"disk_size":"30M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"30.4M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.9,"import_time_s":null,"mem_mb":null,"disk_size":"33M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"22.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":"25M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"21.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.2,"import_time_s":null,"mem_mb":null,"disk_size":"24M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"27.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"okta-jwt-verifier","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":5.6,"import_time_s":null,"mem_mb":null,"disk_size":"30M"}]}}