Strange Gmail login issue: Employees accessing coworker's personal account

We’ve got a weird problem with our Google Workspace setup. We use Okta for authentication. Last week, two of our employees logged in through Okta and ended up in another coworker’s personal Gmail account. This happened to people who don’t even know each other!

Here’s what happened:

  1. Employee A logs in via Okta
  2. Gets redirected to a personal Gmail account of Employee B
  3. Employee A has never met or worked with Employee B

We tried clearing cache and logging out, which fixed it. But we can’t figure out how this happened in the first place. We checked Okta, and there’s no trace of the personal Gmail account there.

Has anyone run into something like this before? Any ideas what might be causing it? We’re stumped and could really use some help figuring this out.

// Example of our login flow
function loginUser(username, password) {
  const oktaResponse = authenticateWithOkta(username, password);
  if (oktaResponse.success) {
    redirectToGoogleWorkspace();
  } else {
    showErrorMessage('Login failed');
  }
}

Thanks for any suggestions!

yo, that’s some crazy stuff happenin there! i’ve seen similar weirdness b4, but not quite like this. maybe check if ur google workspace is set up right? sometimes the sync between okta and google can get messed up. also, make sure ur not using any weird browser extensions that could mess with logins. good luck figuring it out!

I’ve encountered a similar issue in my previous role as an IT admin. It turned out to be a quirk with how our SSO provider was handling token exchanges with Google. We discovered that occasionally, the SSO would send a mismatched user ID to Google, causing this weird account mix-up.

To troubleshoot, I’d suggest checking your Okta logs for any anomalies during these incidents. Look for any discrepancies in the user attributes being passed to Google. Also, review your Google Workspace audit logs to see if there are any unusual patterns in the authentication flow.

One thing that helped us was implementing additional logging on our end to capture the exact state of the auth tokens at each step. This allowed us to pinpoint where the mismatch was occurring.

If you can’t find anything in the logs, it might be worth reaching out to both Okta and Google support. In our case, it ended up being a bug in the SSO provider’s implementation that required a patch.

This is indeed a perplexing issue. I’ve seen similar problems before, and it often stems from caching issues or session conflicts. Given that clearing the cache resolved it, I suspect there might be a problem with how Google’s authentication cookies are being handled in conjunction with Okta.

One possibility to investigate is whether there’s any middleware or proxy in your network setup that could be interfering with the authentication process. These can sometimes cause unexpected behavior with cookies and sessions.

Another avenue to explore is checking your Google Workspace directory settings. Ensure that user accounts are correctly mapped and that there are no unexpected sharing or delegation settings in place.

It might also be worth reviewing your Okta configuration, particularly the SAML settings for your Google Workspace integration. Sometimes, minor misconfigurations can lead to strange authentication behaviors.

If the issue persists, I’d recommend engaging Google Workspace support directly. They have access to more detailed logs and can often spot issues that aren’t visible from the client side.