Skip to content

Conversation

@srushtisv
Copy link
Contributor

@srushtisv srushtisv commented Jul 8, 2025

Add R-GCIP Token-Only Sign Out

PR Description:

This PR introduces a new signOut() behavior for Auth instances when they are operating in a Regionalized GCIP (R-GCIP) token-only mode. Previously, the signOut() method would attempt to clear a standard user session, which is not applicable when only an R-GCIP token is present.

Key Changes:

  1. R-GCIP Token-Only Sign Out:

    • Modified the Auth.signOut() method to correctly handle R-GCIP token-only sessions. If _currentUser is nil (indicating no standard user session) but an R-GCIP token exists, signOut() will now clear the rGCIPFirebaseTokenLock (setting the token to nil) instead of attempting to clear a non-existent standard user session. This ensures that the R-GCIP token is properly invalidated on sign-out.
    • The exchangeToken method no longer explicitly calls signOut() on a standard user session before updating the R-GCIP token, as the general signOut() method now handles both cases implicitly if a user is present.
  2. Auth Instance Management in Sample App (AuthenticationExample):

    • Refactored AppManager in the AuthenticationExample to better manage Auth instances, particularly for regionalized Auth.
    • Introduced cached Auth instances (defaultAppAuth, otherAppAuth, regionalAuthInstance) to avoid repeated creation.
    • The auth() method in AppManager now consistently returns the regionalAuthInstance for regionalized operations, ensuring the correct Auth configuration is always used.
    • Added a standardAuth() method to retrieve standard Auth instances (default or other app) for non-regionalized operations.
  3. Sample App Changes:

    • Added a new AuthMenu option: exchangeTokenSignOut.
    • Implemented callExchangeTokenSignOut() in AuthViewController to demonstrate the new R-GCIP token-only sign-out functionality. This allows users to explicitly sign out a regionalized session that only has an R-GCIP token.

@gemini-code-assist
Copy link
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize 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 is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

@srushtisv srushtisv changed the base branch from main to gcip-byociam July 8, 2025 18:31
@srushtisv srushtisv requested review from ncooke3 and pashanka and removed request for pashanka July 8, 2025 18:31
@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@srushtisv srushtisv self-assigned this Jul 10, 2025
@srushtisv srushtisv marked this pull request as ready for review July 10, 2025 06:21
@srushtisv srushtisv changed the base branch from gcip-byociam to byociam-temp July 10, 2025 08:46
@srushtisv srushtisv changed the base branch from byociam-temp to gcip-byociam July 10, 2025 08:46
@srushtisv srushtisv changed the title [FirebaseAuth] Add exchangeTokenSignOut() for BYO-CIAM [FirebaseAuth] Add Sign-Out Support for BYO-CIAM in Regionalized GCIP Jul 10, 2025
Copy link
Contributor

@pashanka pashanka left a comment

Choose a reason for hiding this comment

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

If the comment is not required please remove it, rest LGTM

Base automatically changed from gcip-byociam to byociam-temp July 10, 2025 09:38
@srushtisv srushtisv requested a review from pashanka July 10, 2025 11:11
@srushtisv srushtisv merged commit 2b0406c into byociam-temp Jul 10, 2025
53 checks passed
@srushtisv srushtisv deleted the byociam-user-signout branch July 10, 2025 13:04
@firebase firebase locked and limited conversation to collaborators Aug 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants