{"id":4294,"library":"types-authlib","title":"Typing stubs for Authlib","description":"This is a type stub package for the Authlib library, providing static type checking for Authlib code. As part of the typeshed project, it's automatically released up to once a day. This version of types-Authlib aims to provide accurate annotations for Authlib==1.6.9. [9, 8, 23]","status":"active","version":"1.6.9.20260408","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["typing","stubs","type hints","authlib","authentication","authorization"],"install":[{"cmd":"pip install types-authlib","lang":"bash","label":"Install types-authlib"}],"dependencies":[{"reason":"Provides the runtime functionality that these stubs type-check. You must install Authlib separately.","package":"Authlib","optional":false}],"imports":[{"wrong":"from authlib_stubs.integrations.flask_client import OAuth","symbol":"OAuth","correct":"from authlib_stubs.integrations.flask_client import OAuth"}],"quickstart":{"code":"import os\nfrom flask import Flask\nfrom authlib.integrations.flask_client import OAuth\n\n# NOTE: For actual use, configure these securely from environment variables\n# or a configuration management system, not hardcoded.\nCLIENT_ID = os.environ.get('GOOGLE_CLIENT_ID', 'your-google-client-id')\nCLIENT_SECRET = os.environ.get('GOOGLE_CLIENT_SECRET', 'your-google-client-secret')\n\napp = Flask(__name__)\napp.config.update({\n    'SECRET_KEY': 'very-secret-key-for-session',\n    'GOOGLE_CLIENT_ID': CLIENT_ID,\n    'GOOGLE_CLIENT_SECRET': CLIENT_SECRET\n})\n\noauth = OAuth(app)\n\noauth.register(\n    name='google',\n    client_id=app.config['GOOGLE_CLIENT_ID'],\n    client_secret=app.config['GOOGLE_CLIENT_SECRET'],\n    access_token_url='https://oauth2.googleapis.com/token',\n    authorize_url='https://accounts.google.com/o/oauth2/auth',\n    api_base_url='https://www.googleapis.com/oauth2/v1/',\n    client_kwargs={'scope': 'openid email profile'}\n)\n\nprint(\"Authlib OAuth client registered for Google. \")\nprint(\"This example demonstrates type-checked setup, but does not run a server.\")\nprint(\"Run a type checker like MyPy on this file after installing types-authlib.\")","lang":"python","description":"This quickstart demonstrates setting up an Authlib OAuth client using Flask integration. While it's a runtime example for Authlib, its purpose here is to show code that `types-authlib` would type-check. You must install `Authlib` (e.g., `pip install Authlib Flask`) and optionally `python-dotenv` for environment variables, in addition to `types-authlib`."},"warnings":[{"fix":"Ensure both `Authlib` and `types-authlib` are present in your project's dependencies.","message":"The `types-authlib` package provides only type stubs and does not install `Authlib` itself. For effective type checking and runtime functionality, you must install both `Authlib` (e.g., `pip install Authlib`) and `types-authlib`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Align the major and minor version of `types-authlib` with your `Authlib` installation (e.g., `pip install 'Authlib==1.6.*' 'types-Authlib==1.6.*'`).","message":"The `types-authlib` package is specifically versioned to target a particular `Authlib` runtime library release (e.g., `types-Authlib==1.6.9.x` provides stubs for `Authlib==1.6.9`). Mismatches between the installed `types-authlib` version and the `Authlib` version can lead to type checking errors or unannotated code.","severity":"breaking","affected_versions":"All versions"},{"fix":"Consider pinning the version of `types-authlib` in your `requirements.txt` or `pyproject.toml` to ensure consistent type checking results across environments.","message":"As `types-authlib` is part of the `typeshed` project, its stubs are automatically released and updated frequently. These updates can sometimes introduce minor changes that might cause new type checker warnings or errors, even if the underlying `Authlib` library has not changed. [8]","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your project is running on Python 3.10 or newer.","message":"`types-authlib` requires Python `>=3.10`. Using it with older Python versions will result in installation failures or compatibility issues. Note that `Authlib` itself dropped Python 2 support with version 1.0.0.","severity":"breaking","affected_versions":"<3.10"},{"fix":"Refer to the Authlib changelog for breaking changes (e.g., `docs.authlib.org/en/latest/history.html`) and update both `Authlib` and `types-Authlib` accordingly.","message":"Authlib itself has undergone significant API changes in major versions (e.g., 0.12, 0.14, 1.0, 1.1) related to grant systems, removal of built-in SQLAlchemy integration, and JOSE module renames. If you upgrade Authlib, ensure you also update `types-authlib` to a compatible version to avoid numerous type checking errors. [1, 2, 4, 5]","severity":"breaking","affected_versions":"Authlib < 1.0"}],"env_vars":null,"search_vec":"'1.6.9':50 '23':53 '8':52 '9':51 'accur':46 'aim':43 'annot':47 'authent':59 'authlib':4,13,20,42,49,58 'author':60 'automat':30 'check':18 'code':21 'day':36 'hint':57 'librari':14 'packag':10 'part':23 'project':27 'provid':15,45 'releas':31 'static':16 'stub':2,9,55 'type':1,8,17,41,54,56 'types-authlib':40 'typesh':26 'version':38","created_at":"2026-04-12T03:49:13.605621+00:00","updated_at":"2026-04-17T14:32:45.964007+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'authlib_stubs'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.7.2.20260827","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/typeshed-internal/stub_uploader","docs":null,"changelog":"https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/Authlib.md","pypi":"https://pypi.org/project/types-authlib/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-29","next_check":"2026-07-10","install_tag":null}}