diff --git a/TokenExchangeAuthenticator/tokenexchangeauthenticator/auth.py b/TokenExchangeAuthenticator/tokenexchangeauthenticator/auth.py index ce3d147..46a345d 100644 --- a/TokenExchangeAuthenticator/tokenexchangeauthenticator/auth.py +++ b/TokenExchangeAuthenticator/tokenexchangeauthenticator/auth.py @@ -275,6 +275,9 @@ def _decode_token(self, token, verify_signature=None): class AuthHandler(BaseHandler): """ A custom request handler that returns user and auth state info + + Args: + force (bool): force a refresh instead of checking last refresh time """ @web.authenticated @@ -288,6 +291,11 @@ async def get(self): raise web.HTTPError(403) self.log.info('User is ' + user.name) + + if self.get_argument('force', False): + self.log.info('Force token refresh instead of checking last refresh time.') + user = await self.refresh_auth(user, force=True) + auth_state = await user.get_auth_state() if not auth_state: # user has no auth state