Skip to content

Commit ef4c10d

Browse files
committed
fix: only modify existing string booleans in Apple backend
1 parent a6e1f09 commit ef4c10d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/satosa/backends/apple.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ def response_endpoint(self, context, *args):
113113

114114
# convert "string or Boolean" claims to actual booleans
115115
for bool_claim_name in ["email_verified", "is_private_email"]:
116-
userinfo[bool_claim_name] = (
117-
True
118-
if userinfo[bool_claim_name] == "true"
119-
else False
120-
)
116+
if type(all_user_claims.get(bool_claim_name)) == str:
117+
all_user_claims[bool_claim_name] = (
118+
True if all_user_claims[bool_claim_name] == "true" else False
119+
)
121120

122121
msg = "UserInfo: {}".format(all_user_claims)
123122
logline = lu.LOG_FMT.format(id=lu.get_session_id(context.state), message=msg)

0 commit comments

Comments
 (0)