Issue with Empty Responses from authenticateUser() and web3auth.getUserInfo() for Coinbase Smart Wallet Integration

Hello Web3Auth team,

I’ve encountered an issue when trying to use Web3Auth with the Coinbase Smart Wallet. Both authenticateUser() and web3auth.getUserInfo() return empty objects when connected with a Coinbase Smart Wallet.

This is problematic for server-side wallet verification, as I’m unable to retrieve the idToken for the wallet because of the empty responses.

Interestingly, these methods work as expected when using social login, and the objects are populated with the expected data. I am using PnP No Modal SDK.

Has anyone else faced this issue, or could there be a workaround for retrieving user information from Coinbase Smart Wallet?

Any insights would be appreciated!

In the screenshot above, you can see that the userInfo object is empty. Additionally, I believe the issue occurs when authenticateUser() attempts to launch the Coinbase Smart Wallet UI to sign the authentication message. However, this error is likely unrelated to the empty userInfo object.

Hey Benny!

Thanks for detailing your setup and mentioning you’re using the PnP (No Modal) SDK with Coinbase Smart Wallet. Since “web3auth.getUserInfo()” and “authenticateUser()” both return empty, it sounds like there might be a limitation retrieving idTokens when using Coinbase Smart Wallet as compared to social logins (which inherently provide OIDC tokens).

To better understand your configuration, could you share:
• Your Web3Auth initialization snippet (how are you configuring the PnP SDK?)
• Any console logs or browser screenshots (beyond the empty userInfo screenshot) that might reveal related warnings/errors

We’ll track this issue for you, and our support engineers will hop in soon.

Let us know, and we’ll help you troubleshoot further!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours

Hello Benny,

Could you please share your Web3Auth SDK version and any code related to the integration?

@yashovardhan, SDK version:

"@web3auth/no-modal@^9.5.0":
  version "9.5.0"
  resolved "https://registry.npmjs.org/@web3auth/no-modal/-/no-modal-9.5.0.tgz#a2f40e2f1ba6e2a29155281ea5c78daec7d2ea4d"
  integrity sha512-kBPoZ7dDso0ekmGajr2ae6XP0c2pMEL7aqNzd8MQxcx7pPqZ/gzrsJrl+vWlLpO1eiFLopt0UxmFpQvLdQNCxQ==
  dependencies:
    "@web3auth/auth" "^9.6.2"
    "@web3auth/base" "^9.5.0"
    "@web3auth/base-provider" "^9.5.0"
    deepmerge "^4.3.1"

"@web3auth/no-modal@^9.5.1":
  version "9.5.1"
  resolved "https://registry.npmjs.org/@web3auth/no-modal/-/no-modal-9.5.1.tgz#69365dd11f6406659018f785da2db6177b4e9d17"
  integrity sha512-4sFaENdGNlcJj+d3PgqDRg41PhId2lM7FyneF+tElUUGHAkXib0cVaRgk1i/8AP9LrdZkxedmm7LJo+iqhM9Cw==
  dependencies:
    "@web3auth/auth" "^9.6.2"
    "@web3auth/base" "^9.5.1"
    "@web3auth/base-provider" "^9.5.1"
    deepmerge "^4.3.1"

The code is quite simple. By the way, it functions well in connecting users to their Coinbase Smart Wallet (CSW), which is the Coinbase wallet accessed via a passkey and distinct from the Coinbase wallet app.

const loginWithCoinbase = async () => {
    await connectTo<void>(WALLET_ADAPTERS.COINBASE);
};
const coinbaseAdapter = new CoinbaseAdapter({
    sessionTime: 3600, // 1 hour in seconds
    adapterSettings: {
      options: "smartWalletOnly",
    },
});
<Web3AuthProvider config={config}>
    ...
</Web3AuthProvider>

Hey @benoit.marcot

Can you check if you can get the id token in our playground? https://pnp-modal-playground.vercel.app/

Just login via your coinbase wallet and navigate to https://pnp-modal-playground.vercel.app/server-side-verification

Please note that in order to get an id token, you must sign a message which pops up in your wallet. This process is automatically done in the case of social login wallets, however for external wallets it has to be done manually.

Hi @yashovardhan

Please check out https://help.coinbase.com/en/wallet/getting-started/smart-wallet

There is no mobile app or Chrome extension with a Coinbase Smart Wallet. As such the screen below does not apply.

Trying with the Playground won’t work: the Web3Auth Playground app supports only “Coinbase Wallet”. I am referring to “Coinbase Smart Wallet” which is a different type of Coinbase Wallet.

  1. Go to https://wallet.coinbase.com/
  2. Click “Connect” in the top navbar, and select “Coinbase Wallet”.
  3. Choose “Smart Wallet (passkey)”, not the mobile app
    image

The Playground only supports mobile wallet connection, or using a Chrome extension which does not support the smart wallet + passkey.

Using the Web3Auth Coinbase adapter, I can login with a Coinbase Smart Wallet, the only issue is I cannot get an idToken.

When you are requesting the id token through the authenticateUser function, do you get a sign message popup on the coinbase smart wallet?

No I didn’t see the signing message. I think that is the issue I posted above: The popup window tries to load but fails. Also please note that the userInfo are also empty (not sure if it triggers a popup with an external wallet).

For external wallets, the userInfo doesn’t contain the id token. You have to manually trigger the authenticateUser function in order to retrieve it.

It is possible that you cannot call authenticateUser() from a useEffect hook, and must call from a button onClick in case of an external wallet. Let me confirm.

@yashovardhan calling from onClick button launches the popup.

However after signing the message with my passkey I get the error below.

Corresponding code:

<Button
    onClick={async () => {
      console.log(await authenticateUser());
    }}
>
    authenticate user
</Button>

Payload posted to https://authjs.web3auth.io/siww/verify:

{
    "signature": {
        "s": "0x00.....000",
        "t": "eip191"
    },
    "message": "https://upsave-webapp-1e7lwame5-upsave.vercel.app wants you to sign in with your Ethereum account:\n0x4fbdB394C9eCf000dBE2047A2a29af21D2F082AD\n\n\nURI: https://upsave-weba*******rcel.app/home\nVersion: 1\nChain ID: 8453\nNonce: bb7cbae13bc21417\nIssued At: 2025-03-27T15:00:07.943Z",
    "issuer": "coinbase",
    "audience": "upsave-we*****ave.vercel.app",
    "timeout": 3600
}

Here is the details of the server response:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Validation failed",
    "validation": {
        "body": {
            "source": "body",
            "keys": [
                "timeout"
            ],
            "message": "\"timeout\" must be greater than or equal to 86400"
        }
    }
}

In the payload, timeout=3600 but apparently endpoint expects timeout>=86400. I don’t think I can configure the timeout in authenticateUser request.

Hey @benoit.marcot thanks a lot for pointing out the exact issue, it helped us fix the particular problem. The fix has been deployed as it is working as expected.

Thanks again for raising the issue.