Skip to content

docs: document leeway and other OAuth2Session options in client_kwargs - #960

Merged
lepture merged 2 commits into
authlib:mainfrom
Xander-AJ:docs/client-kwargs-leeway
Oct 19, 2026
Merged

lepture merged 2 commits into
authlib:mainfrom
Xander-AJ:docs/client-kwargs-leeway

Conversation

@Xander-AJ

@Xander-AJ Xander-AJ commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #687.

client_kwargs is forwarded to OAuth2Session, but the docs only showed scope and two auth options, so options like leeway were only discoverable by reading the code.

This adds a short paragraph and example for leeway (access token expiry, default 60), and notes that the clock skew used to validate id_token claims is a different setting (default 120) passed to authorize_access_token(..., leeway=...). I checked both against authlib/oauth2/client.py and the Django, Flask and Starlette apps.py.

Docs only. Includes a changelog fragment.

Explain that client_kwargs is forwarded to OAuth2Session, show leeway as an example, and distinguish it from the leeway used to validate id_token claims.

Closes authlib#687
@lepture
lepture merged commit 62f8ae8 into authlib:main Oct 19, 2026
15 checks passed
@lepture

lepture commented Oct 19, 2026

Copy link
Copy Markdown
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation for client_kwargs is lacking (e.g. leeway configuration)

2 participants