Not authorized when logout and creating instance
Add TOKEN_DELETE_DISABLED to the settings so when can customize the revocation of tokens on user logout or switch. This solves an issue when a user launches a long running operation and then logs off resulting in an error if the operation tries to validate the token Change-Id: Ic693c563e028081d87b6447b95ac94608da2dafb Closes-Bug: 1599870
This commit is contained in:
parent
0afe75fabc
commit
a8c273f85b
|
@ -143,6 +143,10 @@ def get_keystone_client():
|
|||
return client_v3
|
||||
|
||||
|
||||
def is_token_deletion_disabled():
|
||||
return getattr(settings, 'TOKEN_DELETION_DISABLED', False)
|
||||
|
||||
|
||||
def is_websso_enabled():
|
||||
"""Websso is supported in Keystone version 3."""
|
||||
websso_enabled = getattr(settings, 'WEBSSO_ENABLED', False)
|
||||
|
|
|
@ -178,6 +178,8 @@ def logout(request, login_url=None, **kwargs):
|
|||
|
||||
def delete_token(endpoint, token_id):
|
||||
"""Delete a token."""
|
||||
if utils.is_token_deletion_disabled():
|
||||
return
|
||||
try:
|
||||
endpoint, __ = utils.fix_auth_url_version_prefix(endpoint)
|
||||
|
||||
|
|
Loading…
Reference in New Issue