Skip to content

Commit 1f30670

Browse files
dankingillusional
authored andcommitted
[auth] hd is not present for iam.gserviceaccount.com (#14114)
This would seem to violate this [statement about `hd`](https://developers.google.com/identity/openid-connect/openid-connect#id_token-hd): > The absence of this claim indicates that the account does not belong to a Google hosted domain. but alas, that's the truth. They elide `hd` for iam.gserviceaccount.com accounts.
1 parent 5373bdb commit 1f30670

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hail/python/hailtop/auth/flow.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ async def get_identity_uid_from_access_token(session: httpx.ClientSession, acces
152152
if not (is_human_with_hail_audience or is_service_account):
153153
return None
154154

155-
domain = userinfo.get('hd')
156-
if domain == 'iam.gserviceaccount.com':
155+
email = userinfo['email']
156+
if email.endswith('iam.gserviceaccount.com'):
157157
return userinfo['sub']
158158
# We don't currently track user's unique GCP IAM ID (sub) in the database, just their email,
159159
# but we should eventually use the sub as that is guaranteed to be unique to the user.

0 commit comments

Comments
 (0)