Browser Sign in alert triggered when retrieving session token in AppBridge

Topic summary

A developer is encountering an unexpected browser sign-in alert when retrieving a session token using Shopify’s AppBridge in a React application.

Technical Context:

  • The issue occurs when calling shopify.idToken() within a useEffect hook
  • The token is used for backend communication and validation to verify requests originate from Shopify
  • A screenshot shows the sign-in prompt being triggered

The Problem:
Despite being already logged into the shop through the app, users are being prompted to sign in again when the token retrieval occurs.

Status:
The discussion remains open with no solutions provided yet. The developer is seeking guidance on how to prevent this redundant authentication prompt.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hi everyone, I started noticing this sign in alert is triggered when trying obtain a token from AppBridge, in my react app.

export function Auth() {
const shopify = useAppBridge();
const navigate = useNavigate();

useEffect(() => {
shopify.idToken().then((token) => {
// console.log("Session token: ", token);
 });
}, [navigate, shopify]);

I use this token to communicate with my backend, and the backend validates this token to make sure it comes from Shopify.
Anybody knows how to avoid this? I’m logged into the shop using the app, why am I prompted to log in again?