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
|
return client_v3
|
||||||
|
|
||||||
|
|
||||||
|
def is_token_deletion_disabled():
|
||||||
|
return getattr(settings, 'TOKEN_DELETION_DISABLED', False)
|
||||||
|
|
||||||
|
|
||||||
def is_websso_enabled():
|
def is_websso_enabled():
|
||||||
"""Websso is supported in Keystone version 3."""
|
"""Websso is supported in Keystone version 3."""
|
||||||
websso_enabled = getattr(settings, 'WEBSSO_ENABLED', False)
|
websso_enabled = getattr(settings, 'WEBSSO_ENABLED', False)
|
||||||
|
|
|
@ -178,6 +178,8 @@ def logout(request, login_url=None, **kwargs):
|
||||||
|
|
||||||
def delete_token(endpoint, token_id):
|
def delete_token(endpoint, token_id):
|
||||||
"""Delete a token."""
|
"""Delete a token."""
|
||||||
|
if utils.is_token_deletion_disabled():
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
endpoint, __ = utils.fix_auth_url_version_prefix(endpoint)
|
endpoint, __ = utils.fix_auth_url_version_prefix(endpoint)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue