Get the token from database/storage by the given token string. Developers should implement this method:: def query_token(self, token_string, token_type_hint): if token_type_hint == 'access_token': return Token.query_by_access_token(token_strin
(self, token_string, token_type_hint)
| 74 | return 200, {}, default_json_headers |
| 75 | |
| 76 | def query_token(self, token_string, token_type_hint): |
| 77 | """Get the token from database/storage by the given token string. |
| 78 | Developers should implement this method:: |
| 79 | |
| 80 | def query_token(self, token_string, token_type_hint): |
| 81 | if token_type_hint == 'access_token': |
| 82 | return Token.query_by_access_token(token_string) |
| 83 | if token_type_hint == 'refresh_token': |
| 84 | return Token.query_by_refresh_token(token_string) |
| 85 | return Token.query_by_access_token(token_string) or \ |
| 86 | Token.query_by_refresh_token(token_string) |
| 87 | """ |
| 88 | raise NotImplementedError() |
| 89 | |
| 90 | def revoke_token(self, token, request): |
| 91 | """Mark token as revoked. Since token MUST be unique, it would be |