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
Add is_expired Method for Clients #754
Comments
I suppose the method can have an additional argument {
"secure_protocol": True/False
"token_type": True/False,
"access_token": True/False,
"expire_at": True/False
} A little bit alà pyJWT https://pyjwt.readthedocs.io/en/latest/usage.html#reading-the-claimset-without-validation Thoughts? |
That doesn't seem necessary to me, the existing
It might look like this
Which seems a bit cleaner to me. |
The problem with this approach is twofold:
Any Thoughts? |
I'm not arguing for moving everybody to that approach, the same check will occur with the same exception so I'm not sure how the interface is different. I'm just requesting that the check be put in a visible method in case someone wanted to check it themselves. |
Ah sure, then I don't have objections, it seems a reasonable PR :) |
Currently, Oauth2 clients contain properties
expires_in
and_expires_at
.In the method which adds the token to a request, the fields are used liked this:
It would be useful to someone using the client to be able to check whether the token is expired before they try to add it to a request. Currently, in order to do that they would have to go into the code and see that it uses the time library and duplicate the above line of code.
It would be much more convenient (and more organized in the code itself) to have this be a method
is_expired()
which could then be exposed to users of the client.Applies to Oauth2 Client side code.
The text was updated successfully, but these errors were encountered: