-
-
Notifications
You must be signed in to change notification settings - Fork 510
verify_hash #771
Comments
We can make it optional under a configuration, but in general it should not be removed if we want to invalidate tokens when user changed her password (e.g. after a leak and someone could generate their own tokens). |
I have been thinking about this. |
I really love the idea to avoir doing computation for each request, even more network / database accesses are required. So your idea @jwag956 looks cool. However, for such issue, I don't want to break the current API, so the implementation you suggests should be at least optional as all user that want to use it have to change upgrade their models. This is not something easy to do, and I think such change must not be mandatory althrought it can be a great improvement. Some other thought about your proposal jwag are :
I really think this kind of problem should be solved using cache, but here again, I am not totally sure of what I say :) |
Thanks for your input. Second - (and I do have some experience in this) - the actual contents of the authorization token is application specific - the current flask-security auth token contains: SIgning is what allows the server to trust the incoming data - so an attacker can't just try different values since they can't sign the token correctly. Note that more secure than the token is the cookie which you get as part of session (if you are a browser) - this cookie just has the user_id in it - much more secure that a UI trying to locally store the authentication token... I think a cache is fine - but it has a couple shortcomings:
|
when i use auth_token_required, the verify_hash function is too slow,how can i optimize it?
The text was updated successfully, but these errors were encountered: