Authenticate a user by the token specified in load. Return the token object or False if auth failed.
(self, load)
| 496 | self.cache.clean_expired("tokens") |
| 497 | |
| 498 | def authenticate_token(self, load): |
| 499 | """ |
| 500 | Authenticate a user by the token specified in load. |
| 501 | Return the token object or False if auth failed. |
| 502 | """ |
| 503 | token = self.get_tok(load["token"]) |
| 504 | |
| 505 | # Bail if the token is empty or if the eauth type specified is not allowed |
| 506 | if not token or token["eauth"] not in self.opts["external_auth"]: |
| 507 | log.warning('Authentication failure of type "token" occurred.') |
| 508 | return False |
| 509 | |
| 510 | return token |
| 511 | |
| 512 | def authenticate_eauth(self, load): |
| 513 | """ |
no test coverage detected