OAuth Authentication
Implementing OAuth login with Para in React Native and Expo applications
Para supports OAuth authentication in React Native and Expo applications, allowing users to sign in using popular providers like Google, Discord, and Farcaster. This guide explains how to implement OAuth login in your mobile app using Para’s React Native SDK.
The OAuth flow in mobile applications requires handling browser sessions and deeplinks to redirect users back to your app after successful authentication. Once the OAuth flow completes, Para uses the returned email to authenticate users through the standard email-based flow, creating or authenticating with a native passkey.
Prerequisites
Before implementing OAuth authentication, ensure you have completed the basic Para setup for your React Native or Expo application.
Implementation
Installation
Install the In-App Browser package to handle OAuth redirects securely:
For iOS, add the following to your Info.plist
to define your URL scheme:
For Android, add your URL scheme to AndroidManifest.xml
:
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, including shared security context with the device’s browser, protection against common web vulnerabilities, and support for modern authentication methods.
Implementing Authentication
Installation
Install the In-App Browser package to handle OAuth redirects securely:
For iOS, add the following to your Info.plist
to define your URL scheme:
For Android, add your URL scheme to AndroidManifest.xml
:
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, including shared security context with the device’s browser, protection against common web vulnerabilities, and support for modern authentication methods.
Implementing Authentication
Installation
Install the Expo Web Browser package:
Configure your app.json with the URL scheme:
After updating your app.json, run the following command to rebuild native iOS and Android files:
For Expo Router apps, create a +native-intent.tsx
file in your project root to handle deeplinks:
The browser packages used for OAuth share cookies, cache, and session data with the device’s native browser. This means users already logged into OAuth providers in their device browser will stay logged in. If you encounter authentication issues, try clearing the cache and history in the device’s native browser.
Implementing Authentication
OAuth authentication with Para still requires creating a native passkey to secure the user’s wallets. After OAuth completes, Para associates a native passkey with the user’s account. For returning users, the native passkey is used for authentication. The passkey is associated on a per-app basis, making authentication streamlined, and users will only see passkey options they created for your specific app.
Examples
Explore our complete example implementations for OAuth authentication with Para:
Next Steps
After integrating Para, you can explore other features and integrations to enhance your Para experience.