Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions TokenExchangeAuthenticator/tokenexchangeauthenticator/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down