Skip to main content
Para supports OAuth authentication with providers like Google, Apple, Discord, X, and Facebook. Use authenticateWithOAuth() to handle the entire OAuth flow in a single call — it manages the redirect, polls for completion, and creates wallets for new users. If your app opts in to Para’s updated authentication flow, see Updated Authentication Flow for the passkey steps your app handles.
Have your own OpenID Connect provider? Once you set up Custom OIDC, pass "CUSTOM_OIDC" as the method here — it works like any other provider.A provider added as a named connection with a handle (your own OAuth 2.0 provider, or an additional OIDC provider) signs in with para.authenticateWithCustomOAuth() instead. Pass provider ("CUSTOM_OIDC" or "CUSTOM_OAUTH") and the connection’s providerConfigHandle, along with the same appScheme and redirectCallbacks.onOAuthUrl you pass to authenticateWithOAuth. It returns the same result.

Prerequisites

Before implementing OAuth authentication, ensure you have completed the basic Para setup for your React Native or Expo application.

Standard OAuth

Use para.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.

Installation

Install the In-App Browser package to handle OAuth redirects:
For iOS, add the following to your Info.plist to define your URL scheme:
For Android, add your URL scheme to AndroidManifest.xml:

Implementation

Both react-native-inappbrowser-reborn and expo-web-browser use secure browser implementations that leverage the device’s native browser engine rather than a WebView. This provides stronger security protections and support for modern authentication methods.

Updated Authentication Flow

We recommend opting in to Para’s updated authentication flow with the supportsAuthV2 option; it becomes the default in the next major version. Once your app opts in (see Email & Phone Login), keep calling authenticateWithOAuth exactly as shown above. Para decides which sign-in experience runs for your app, so build for both:
  • Para’s updated authentication flow. The URL passed to onOAuthUrl is a Para-hosted page that runs the provider sign-in. redirectCallbacks.onOAuthUrl is required, and pass appScheme so the page returns to your app when it’s done. While the call is pending:
    • A new user creates their first credential once authStateInfo.isCredentialSetup is true. On a passkey app, call registerPasskey(authStateInfo.passkeyId) when passkeyId is set. Otherwise open authStateInfo.passwordUrl or authStateInfo.pinUrl in your in-app browser, with your nativeCallbackUrl appended, so the user sets a password or PIN on a Para-hosted page.
    • A returning user whose account is protected by a passkey is returned to your app and onPasskeyLoginRequired fires. Close the in-app browser if it’s still open and call loginWithPasskey(). That passkey must belong to the account the provider signed in, or the call fails.
    • A returning password or PIN user unlocks on the Para-hosted page.
  • Without the opt-in. The provider sign-in and passkey steps work as described in the rest of this guide.
This hook handles those steps. It uses the openAuthUrl helper from Email & Phone Login, which appends your nativeCallbackUrl.
useOAuthCredentialSteps.ts
On Para’s updated authentication flow, calling authenticateWithOAuth without redirectCallbacks.onOAuthUrl throws, because your app has to open the Para-hosted page.

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 via window.ReactNativeWebView.postMessage(). You must forward messages from the WebView to the SDK using para.handleWebViewMessage().
Telegram and Farcaster cannot use InAppBrowser or expo-web-browser because the portal needs a live message channel to send authentication events (TELEGRAM_SUCCESS, FARCASTER_SUCCESS) back to the SDK. Only a WebView provides this channel via onMessage.
On the updated authentication flow, Telegram and Farcaster sign-ins finish when Para confirms the session, so the pending authenticateWithOAuth call resolves without the WebView events. The WebView setup below works on both flows, so keep it.
Install react-native-webview if you haven’t already:

Method Reference

On Para’s updated authentication flow, the sign-in runs on a Para-hosted page published as authStateInfo.oauthUrl (Telegram and Farcaster included). On the web, open a blank popup in the click handler before calling this method, then point it at oauthUrl from your para.onStatePhaseChange() listener. The same listener opens the passkey, password, or PIN creation page if a new account has to set one up. See the guide for your platform for the full pattern.

Cancelling Authentication

When the user closes the in-app browser without finishing, call para.cancelAuthFlow(). It returns the auth flow to unauthenticated, and the pending authenticateWithOAuth call rejects. Both openAuth and openAuthSessionAsync resolve with a result whose type tells you how the browser closed:
You can also stop waiting with sessionPollingCallbacks.isCanceled. Return true from it to stop the session polling loop, and the optional onCancel callback fires:
Without the opt-in, oAuthPollingCallbacks accepts the same callbacks for the provider sign-in step. Para’s updated authentication flow doesn’t read oAuthPollingCallbacks, so use cancelAuthFlow() or sessionPollingCallbacks there.
Calling para.logout() also cancels all active polling, resets the state phases back to unauthenticated, and clears the stored session.

Handling Results

authenticateWithOAuth() returns the same AuthenticateResponse as email/phone auth. See the authentication guide for full response type documentation.

Next Steps