Skip to content

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

Description

@hfroot

Describe the bug

I needed to configure leeway to be shorter than the default 60 seconds.

It took me a long time and a lot of reading the code to realize that I can pass leeway to the client_kwargs (using OAuth2 with Django, Authlib v 1.3.2):

    oauth.register(
        name="...",
        server_metadata_url=settings.MY_CONFIG,
        client_kwargs={
            "scope": "...",
            "leeway": 30
        },
    )

Error Stacks

N/A

To Reproduce

N/A

Expected behavior

I would like to see documentation on client_kwargs.

From what I understand of the code:

  • leeway is passed as a kwarg to both OAuth2Session and OAuth2Client. Along with client_id, client_secret, token_endpoint_auth_method, revocation_endpoint_auth_method, scope, state, redirect_uri, token, token_placement, update_token, leeway, default_timeout
  • OAuth2Session is given as the client class of DjangoOAuth2App
  • when this client is instantiated, it is given kwargs
  • these kwargs are generated by generate_client_kwargs

... honestly at this point I get a little lost. I would write the docs but I don't want to suggest the wrong thing. Which parameters are configurable? And are they configurable during the register method as shown above or should they be configured from settings.py?

Environment:

  • OS:
  • Python Version:
  • Authlib Version: 1.3.2

Additional context

Add any other context about the problem here.

Activity

  1. added
    role:client
    on Apr 2, 2025
  2. added theissue type on Apr 30, 2025
  3. added a commit that references this issue on Oct 15, 2026
    170b49a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationrole:client

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions