authenticateWithOAuth() to handle the entire OAuth flow in a single call — it manages the redirect, polls for completion, and creates wallets for new users.
Prerequisites
Before implementing OAuth authentication, ensure you have completed the basic Para setup for your React Native or Expo application.Standard OAuth
Usepara.authenticateWithOAuth() to authenticate a user via a third-party OAuth provider. The method manages the OAuth redirect, polls for completion, waits for session establishment, and creates wallets for new signups.
For standard OAuth providers, use the onOAuthUrl callback to open the OAuth URL in an in-app browser.
- React Native
- Expo
Telegram & Farcaster
Telegram and Farcaster authentication require a different approach than standard OAuth. These providers authenticate through Para’s hosted portal, which needs to send events back to the SDK when authentication completes. On mobile, this requires opening the portal in a WebView (not an in-app browser) so the portal can communicate viawindow.ReactNativeWebView.postMessage().
You must forward messages from the WebView to the SDK using para.handleWebViewMessage().
Install
react-native-webview if you haven’t already:Method Reference
This method must be paired with
para.onStatePhaseChange() to handle portal URLs that appear after OAuth completes (e.g. passkey or password setup for returning users). See the guide for your platform for the full state listener pattern.Cancelling Authentication
Both OAuth polling and session polling accept anisCanceled callback. Return true from isCanceled to stop the polling loop — for example, when the user dismisses the in-app browser or navigates away. The cancellation is clean: no error is thrown, and the optional onCancel callback fires.
para.logout() also cancels all active polling and resets the state phases back to unauthenticated. This is useful for implementing a “Cancel” button that fully resets the auth flow:
Handling Results
authenticateWithOAuth() returns the same AuthenticateResponse as email/phone auth. See the authentication guide for full response type documentation.