[Archive] Apple Login Fails with Error: "Oops! Something went wrong"

:classical_building: Archived Content from Web3Auth Community

This topic was originally posted by yurii.o on 7/14/2025.
This content has been migrated from our previous community forum to preserve valuable discussions.


Details:

Issue Description:

We are integrating Web3Auth in our React Native application. On iOS devices, we’ve encountered a recurring issue where users are unable to log in with Apple on their very first attempt. This issue occurs only on the initial attempt and only on iOS.

After some investigation, we found that disabling “Prevent Cross-Site Tracking” in device settings can help in some cases. However, this workaround is not practical for end users.

Initialization:

import Web3Auth, { LOGIN_PROVIDER } from '@web3auth/react-native-sdk';
import { WEB3AUTH_NETWORK, getEvmChainConfig } from '@web3auth/base';
import * as WebBrowser from '@toruslabs/react-native-web-browser';
import { EthereumPrivateKeyProvider } from '@web3auth/ethereum-provider';

const clientId = <KEY>;
const newChainConfig = getEvmChainConfig(0x01, clientId)!;

const privateKeyProvider = new EthereumPrivateKeyProvider({
config: { chainConfig: newChainConfig },
});

export const web3auth = new Web3Auth(WebBrowser, EncryptedStorage, {
clientId,
redirectUrl,
network: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
privateKeyProvider,
});

Login Flow:

 await web3auth.login({
   loginProvider,
   redirectUrl: redirectUrl
 });

Additional Observations:

We switched to using @swan-io/react-native-browser as the in-app browser module, which improved the situation for most users.

However, the login process can still take up to 30 seconds to complete. This delay seems to be related to the Web3Auth server response time.

Although switching the browser has reduced visible errors, there is no guarantee that this solution will work reliably for all users without a clear understanding of the underlying issue.

Questions:

  • It seems like this issue has existed for a few years. Are there any proven, 100% reliable solutions available?
  • Is this a known limitation of Web3Auth + Apple login on iOS?
  • Could it be related to in-app browser handling or deep linking?

Any advice or insights would be greatly appreciated. Thank you!

Thank you for providing such a detailed report! Here’s a summary of your issue for the support team, along with some initial insights and next steps:


Issue Summary

  • SDK: Web3Auth Plug and Play (PnP) React Native SDK
  • SDK Version: @web3auth/react-native-sdk@^8.1.0
  • Platform: React Native 0.75.5 (iOS only, not Android)
  • Login Provider: Apple
  • Error: “Oops! Something went wrong” — occurs on the first login attempt, only on iOS.
  • Workaround: Disabling “Prevent Cross-Site Tracking” in iOS settings sometimes helps, but is not practical for end users.
  • Browser Module: Switched from @toruslabs/react-native-web-browser to @swan-io/react-native-browser, which reduced but did not eliminate issues.
  • Other Observations: Login process can be slow (up to 30 seconds). Issue is persistent for some users.
  • Code Snippets Provided: Yes (initialization and login flow)
  • Screenshot Provided: Yes (error message screenshot)

Questions Raised

  1. Is this a known limitation with Web3Auth + Apple login on iOS?
  2. Are there any proven, 100% reliable solutions?
  3. Could this be related to in-app browser handling or deep linking?

Relevant Details for Support Team

  • Initialization Code: Provided in the message.
  • Login Call: Standard usage with loginProvider: LOGIN_PROVIDER.APPLE.
  • Redirect URL: Used as per documentation.
  • No Custom Verifier / dApp Share: Standard Apple login, not using custom authentication.
  • No JWT/JWKS Details: Not relevant for this case.

Initial Insights & Suggestions

This issue is a known challenge with OAuth flows on iOS, especially when using in-app browsers (SFSafariViewController, ASWebAuthenticationSession) due to Apple’s privacy settings like “Prevent Cross-Site Tracking.” Web3Auth has documented similar issues in the past, and some best practices are:

  • Use Deep Linking Properly: Ensure your redirect URL is registered and handled correctly in your app and on the Web3Auth dashboard. See Web3Auth Deep Linking Guide.
  • Browser Module Choice: You’ve already tried switching browser modules. @swan-io/react-native-browser is generally more reliable, but limitations from iOS privacy settings may still apply.
  • Session Management: Sometimes, clearing cookies/session data on the first login attempt causes issues. Double-check if your implementation or the browser module is clearing sessions between attempts.
  • User Education: While not ideal, some apps notify users about the need to disable “Prevent Cross-Site Tracking” for smoother login, but this is not a recommended UX.

Documentation & References


Next Steps for Support

  • Is there an updated workaround or fix for Apple login on iOS, given the current SDK version and browser module?
  • Is there any recommended configuration for the browser module or redirect URL that increases reliability?
  • Are there any plans for a more robust solution in future SDK releases?

Yurii, thank you for your patience and for providing all the necessary details! The support team will review your case and respond with the latest guidance. If you have any additional logs or can share a minimal reproducible example, that could help speed up troubleshooting.

Let me know if you have any further questions or updates!

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