Skip to content

Conversation

@Forbrig
Copy link
Contributor

@Forbrig Forbrig commented Jan 8, 2026

TICKET: https://bitovi.atlassian.net/browse/FE-662

This pull request adds support for Google Drive as a new OAuth provider throughout the authentication and token management flow. The changes ensure Google credentials are handled alongside existing Atlassian and Figma providers, including connection, token refresh, JWT creation/validation, and provider registration. The update also introduces a Google API client for authenticated requests.

Google Drive provider integration:

  • Added google as an optional provider in the AuthContext, MultiProviderTokens, and related type definitions, enabling storage and handling of Google OAuth tokens. [1] [2]
  • Updated authentication logic to recognize Google as a valid provider when checking for credentials, token expiry, and JWT payload validation. [1] [2] [3] [4]
  • Modified the provider connection flow to allow Google Drive connection, display its status in the UI, and require Google as a valid provider for session creation. [1] [2] [3] [4]

Token refresh and management:

  • Updated the token refresh logic to support Google tokens, including extracting, refreshing, and storing new Google credentials in the multi-provider token structure. [1] [2] [3] [4] [5] [6]
  • Adjusted token logging and expiry checks to include Google tokens, ensuring consistent handling with other providers. [1] [2]

Provider registration and API client:

  • Registered Google Drive tools with the MCP server when Google credentials are present, enabling Google Drive features for authenticated users. [1] [2]
  • Added a new google-api-client.ts file implementing a Google API client for authenticated requests using OAuth tokens, including a method to fetch user info from the Drive API.

Error handling and messaging:

  • Updated error messages and validation logic to reference Google as a valid provider, ensuring users are informed about missing credentials for any supported provider.

These changes collectively enable Google Drive integration for authentication, session management, and API access within the existing multi-provider framework.

@Forbrig Forbrig marked this pull request as ready for review January 8, 2026 15:28
const authInfo = authContextStore.get(sessionId);

if (authInfo && (authInfo.atlassian || authInfo.figma)) {
if (authInfo && (authInfo.atlassian || authInfo.figma || authInfo.google)) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should do some cleanup to make our auth providers more abstract and code like this just loops through them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would suggest creating a new ticket to improve the overall authentication code. I would rather not add new code to the current implementation on this MR. Do you mind creating a ticket and assigning it to me?


if (googleTokens && googleTokens.access_token && googleTokens.refresh_token) {
console.log(' Adding Google credentials to JWT');
multiProviderTokens.google = {
Copy link
Member

Choose a reason for hiding this comment

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

similar here, this code is the same for each provider

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as before. This can be added to the next ticket for authentication improvement.

<div class="provider ${connectedProviders.includes('google') ? 'connected' : ''}">
<h2>Google Drive</h2>
<p>Access Google Drive files and user information</p>
Copy link
Member

Choose a reason for hiding this comment

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

probably just "google drive" files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed

async refreshAccessToken(
params: RefreshTokenParams
): Promise<StandardTokenResponse> {
const clientId = process.env.GOOGLE_CLIENT_ID!;
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to update the contributing docs and point people where to create a google_client_id and such.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@justinbmeyer justinbmeyer merged commit 7de4a48 into main Jan 8, 2026
4 checks passed
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.

3 participants