lepture / authlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
https://authlib.org/
BSD 3-Clause "New" or "Revised" License
4.49k stars 448 forks source link

Allow falsey but non-None grant uri params #544

Closed schnerd closed 1 year ago

schnerd commented 1 year ago

There are use cases where you want to pass 0 to authorize_redirect, for example Auth0 allows you to force login again by passing max_age=0, as described here.

The current code for prepare_grant_uri filters out such parameters. This PR changes that to explicitly filter out None instead.

What kind of change does this PR introduce? (check at least one)

Does this PR introduce a breaking change? (check one)

Debatable? Technically a breaking change if someone was passing a non-None falsey value to authorize_redirect() previously.


lepture commented 1 year ago

Thanks