Is it possible to configure leeway for authlib django?

I'm using Authlib with Django. We're migrating from one identity provider to another, and the new one has a much smaller expires_in for their tokens (going from 3600 to 60). 60 is the default leeway time, so when I try to do oauth.<idp_name>.userinfo(token=token) like I did before, it checks if the token is expired, link to definition of is_expired.

I cannot pass leeway directly to authlib.integrations.django_client.OAuth() which is what I'm using to then register the IdP. It doesn't seem to be an option for the register method nor the config in settings.py.

I see that leeway could be passed to OAuth2Client but I can't figure out when that class is instantiated or if I have any control over defining the variable at that point.

I'm starting to think that it is simply not yet possible with the library (given that a similar demand was made previously) but I wanted to check here first before I submit a feature request.

Вернуться на верх