Fix more data type mismatch when checking OAUTH2 claims

pull/6979/head
Martin Tietz 2023-11-17 12:00:04 +01:00 committed by GitHub
parent 0bc044fa67
commit 23c618e1c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -243,6 +243,8 @@ class OAuth2Authentication(BaseAuthentication):
if not isinstance(claim, list): if not isinstance(claim, list):
claim = [claim] claim = [claim]
authorized_claims = additional_claims.get(key) authorized_claims = additional_claims.get(key)
if not isinstance(authorized_claims, list):
authorized_claims = [authorized_claims]
if any(item in authorized_claims for item in claim): if any(item in authorized_claims for item in claim):
reason = "Claim match found. Authorizing" reason = "Claim match found. Authorizing"
return (True, reason) return (True, reason)