Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hfroot opened this issue Nov 26, 2024 · 0 comments
Open
Assignees

Comments

@hfroot
Copy link

hfroot commented Nov 26, 2024

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.

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

No branches or pull requests

2 participants