Skip to content

fix(oauth2): validate Firebase issuer and warn on omitted audience in verify_firebase_token - #18777

Draft
macastelaz wants to merge 2 commits into
mainfrom
fix/verify-firebase-token-issuer
Draft

macastelaz wants to merge 2 commits into
mainfrom
fix/verify-firebase-token-issuer

Conversation

@macastelaz

Copy link
Copy Markdown
Contributor

Validates that the decoded Firebase ID token contains a non-empty 'aud' claim and that 'iss' matches 'https://securetoken.google.com/', and emits a UserWarning when 'audience' is omitted in verify_firebase_token().

Context: b/511890255

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances security in both the synchronous and asynchronous implementations of verify_firebase_token by validating the token's audience (aud) and issuer (iss) claims. It also introduces a warning when the function is called without an audience, as this can be insecure. Comprehensive unit tests have been added to verify these validations and warnings. I have no additional feedback to provide as the changes are well-implemented and properly tested.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant