`getAccessTokenSilently` for google social login failed with "Failed Silent Auth - Login required"

We want our application to provide both password and social login with organization support.

We implement it with the following flow:

  1. loginWithRedirect without organization info.
  2. After figuring out which org the user needs to login into or whenever user switches organization, use getAccessTokenSilently with ignore cache to refresh the access token with org info.

The flow works fine with password login and we are able to obtain an access token with silent auth. However, in the case of google social login, the flow fails at the silent auth. The error reported in the log is Failed Silent Auth - Login required.

I tried this with a few browser:

  • Chrome: password flow works but google social flow doesn’t work.
  • Safari: password flow works but google social flow doesn’t work.

I read through this question. The symptom is very similar and the problem seems related to cookies. But we are already using paid subscriptions and the custom domain.

I also read through this question. But the problem seems different as my password flow actually works fine.

We are also not able to use the refresh token flow in Auth0Provider as it doesn’t work with organization auth, similar to this question.

Here is our setup:

SDK:

Auth0 Provider:

    <Auth0Provider
      audience={config.AUTH0_AUDIENCE}
      domain={config.AUTH0_DOMAIN}
      clientId={config.AUTH0_CLIENT_ID}
      redirectUri={window.location.origin}
    >
      {children}
    </Auth0Provider>

First login without organization:

      loginWithRedirect({ audience: config.AUTH0_AUDIENCE });

Refresh an access token with organization info via silent auth:

      const token = await getAccessTokenSilently({
        ignoreCache: true,
        audience: config.AUTH0_AUDIENCE,
        organization: orgId,
      });

How to make silent auth work with social login and organization? Can anyone help point me in the right direction? Thank you!

Update:

  • I’m using my own google developer credentials in testing this, rather than auth0’s shared development keys.

Hey @billyf welcome back, and thanks for the detailed description of the issue!

Any chance you are using Auth0 developer keys for your Google connection in testing this?

Hi @tyf

Thanks for your reply. No, I’m using my own google developer credential in testing google connection.

1 Like

No problem, happy to help!

A couple follow up questions:

  • Is the google connection enabled for the particular organization you are attempting to silent auth into?

  • Is the user already a member of the organization and/or is membership on authentication enabled in the organization settings?

1 Like

Enable google connect for the organization solves my issue.

Thank you very much for your answer!

1 Like

Wonderful! Thanks for confirming here :rocket:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.