Get another user IdToken without disrupting session

Hi all,

is it some way to authenticate as another user and obtain their ID token without disrupting the current session ?

I tested something like

  const authenticateUser = async () => {
    const a0 = new Auth0Client({
      domain: AUTH0_ISSUER_BASE_BUILDER,
      client_id: AUTH0_CLIENT_ID,
    })

    await a0.loginWithPopup({
      max_age: 0,
      scope: AUTH0_SCOPE,
    })
    return await a0.getIdTokenClaims()
  }

also tested with

await a0.getIdTokenClaims({
  scope: AUTH0_SCOPE,
})

but all tried solutions change the current session to the user i authenticated in popup.

Hey @alexandro.oliveira !

Can you elaborate a bit on your specific use case here? Are you attempting to alter anything about the ID token when obtaining a new one? What exactly do you need a new ID token for?

I am currently logged in with Google. Now, I want to open a popup to log in or sign up with a different account. If successful, I aim to obtain the ID Token. Before calling the endpoint to link this account to my existing one, I plan to conduct some checks in my backend. However, if my backend rejects this link and I refresh the page, the account that appears as currently logged in is the one I attempted to link, not my original account.

Another information, the current behaviour is happening on version auth0-react 1.6.x

when i updated to 2.2.x, the adapted code open a popup.

In the end, i have same issue, i cant log in on popup, and get the idToken without ending current session.