Prerequisites
Enable in Developer Portal
Password and PIN authentication must be enabled in your under the Security settings for your API key. Once enabled, Para publishespasswordUrl or pinUrl in authStateInfo while authenticateWithEmailOrPhone() or authenticateWithOAuth() is pending.
How It Works
The user creates or enters their password or PIN on a Para-hosted page. Your app opens that page in an in-app browser when the URL appears inauthStateInfo (from para.onStatePhaseChange()). Your pending authenticateWithEmailOrPhone() or authenticateWithOAuth() call keeps waiting while the user is on the page, and resolves once the user has an active session and wallets. You don’t call any other method to finish.
Open each page with your app’s nativeCallbackUrl appended, so the page closes the browser and returns to your app when it finishes.
On the Updated Authentication Flow (Recommended)
Once your app opts in withsupportsAuthV2: true (see ):
- New users create their password or PIN after verifying their email or phone, or after the provider sign-in for OAuth. Open
authStateInfo.passwordUrlorauthStateInfo.pinUrlonceauthStateInfo.isCredentialSetupistrueandpasskeyIdisn’t set. - Returning users enter their password or PIN on the same Para-hosted page they verify on. Your app only opens the verification page (
authStateInfo.verificationUrl), or the OAuth page passed toonOAuthUrl.
Without the Opt-In
Without the opt-in,passwordUrl or pinUrl appears in authStateInfo at the awaiting_session_start phase, both for a new user creating a credential and for a returning user entering one. Open it in your in-app browser:
- React Native
- Expo
onStatePhaseChange listener can fire more than once with the same URL, so the examples open each URL only once and unsubscribe when the sign-in call settles. The listeners in show how, and handle the password and PIN pages along with the rest of the sign-in, so you don’t need extra code when you use them.