Skip to content

fix(appcheck): clearer fac debug token logging#16197

Draft
ncooke3 wants to merge 2 commits into
mainfrom
nc/fix-facdebug-logging
Draft

fix(appcheck): clearer fac debug token logging#16197
ncooke3 wants to merge 2 commits into
mainfrom
nc/fix-facdebug-logging

Conversation

@ncooke3
Copy link
Copy Markdown
Member

@ncooke3 ncooke3 commented May 22, 2026

When a debug token is provided to FirebaseAppCheck via environment variable, the locally generated one is still printed, despite it being unused. This is confusing.

This PR doesn't stop the locally generated token from being generated and stored, but it no longer logs it when the env var token is set.

A subsequent run without the env var set will log the token.

cc: @rizafran

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Comment on lines -29 to -31
// Print only locally generated token to avoid a valid token leak on CI.
FIRLogWarning(kFIRLoggerAppCheck, kFIRLoggerAppCheckMessageCodeDebugToken,
@"Firebase App Check debug token: '%@'.", [provider localDebugToken]);
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.

I'd need to run it to verify but I think we may just want to delete lines 29-31. This functionality should ideally live, IMHO, only in AppCheckCore since Google Sign-In integrates directly with it.

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.

It seems like AppCheckCore is behaving correctly in terms of when to log the token. I just forgot to remove it here when splitting it off.

Copy link
Copy Markdown
Member Author

@ncooke3 ncooke3 May 22, 2026

Choose a reason for hiding this comment

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

I scoped it down in eeb69f8 but I think it's reasonable to fix this by just removing it entirely.

Would need to also update example snippet in docs:

https://firebase.google.com/docs/app-check/ios/debug-provider#:~:text=Firebase%20App%20Check%20Debug%20Token%3A

Copy link
Copy Markdown
Member Author

@ncooke3 ncooke3 May 22, 2026

Choose a reason for hiding this comment

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

Ah, we can remove it but do need to update the debug log snippet in https://firebase.devsite.corp.google.com/docs/app-check/ios/debug-provider

And consider how to fit in the pointer to the debug token registration on the Firebase console. Either in token log and/or catching exchangeDebugToken failure.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants