Skip to content

Commit c4462ab

Browse files
committed
Require non-empty ID token audience
1 parent ffe213d commit c4462ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

google_yubikey/device.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def get_id_token(yubikey: YubiKey, slot: int, prompt_management_key: bool,
131131
service_account_email: str, audience: str,
132132
token_lifetime: int, stream=sys.stderr):
133133
""" Generates a Google ID token with a YubiKey """
134+
if not audience:
135+
raise ValueError('ID tokens must use a non-empty audience')
134136
return _get_jwt(
135137
yubikey, slot, prompt_management_key,
136138
service_account_email, audience, [], token_lifetime, stream,

0 commit comments

Comments
 (0)