diff --git a/galaxy_ng/app/auth/auth.py b/galaxy_ng/app/auth/auth.py index f3ded84ba..9a27f0489 100644 --- a/galaxy_ng/app/auth/auth.py +++ b/galaxy_ng/app/auth/auth.py @@ -47,8 +47,8 @@ def authenticate(self, request): if identity is None: raise AuthenticationFailed - identity_type = identity["type"] - if identity == "User": + identity_type = identity.get("type", "User") + if identity_type == "User": try: identity = header['identity'] account = identity['account_number'] @@ -57,7 +57,7 @@ def authenticate(self, request): username = user['username'] except KeyError: raise AuthenticationFailed - elif identity == "ServiceAccount": + elif identity_type == "ServiceAccount": try: service_account = identity['service_account'] # service-account- is too long for the username field