> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Password or PIN

> Add password or PIN authentication to your React Native or Expo app

export const Link = ({href, label, newTab = false}) => {
  const [isHovered, setIsHovered] = useState(false);
  return <a href={href} target={newTab ? '_blank' : '_self'} rel={newTab ? 'noopener noreferrer' : undefined} className="not-prose inline-block relative text-black font-semibold cursor-pointer border-b-0 no-underline" onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
      {label}
      <span className={`absolute left-0 bottom-0 w-full rounded-sm bg-gradient-to-r from-orange-600 to-purple-600 transition-all duration-300 ${isHovered ? 'h-0.5' : 'h-px'}`} />
    </a>;
};

Para supports password and PIN-based authentication as alternatives to passkeys. When enabled on your API key, users create or enter their credentials on Para's secure portal, which opens in the device browser. This is an optional enhancement — basic email/phone login works without any additional security method.

## Prerequisites

<CardGroup cols={1}>
  <Card horizontal title="Email & Phone Login" imgUrl="/images/v3/custom-ui-social.png" href="/v3/react-native/guides/add-email-phone" description="Complete the basic authentication setup first" />
</CardGroup>

## Enable in Developer Portal

Password and PIN authentication must be enabled in your <Link label="Developer Portal" href="https://developer.getpara.com/" /> under the Security settings for your API key. Once enabled, `authenticateWithEmailOrPhone()` will return `passwordUrl` or `pinUrl` in the auth state, and the state listener will automatically open them.

## How It Works

When a user signs up or logs in with password/PIN enabled, the SDK generates a `passwordUrl` or `pinUrl`. This URL points to Para's hosted portal where the user enters their credentials securely.

On mobile, you open this URL in the device's in-app browser. After the user completes the portal flow, call `waitForWalletCreation()` (new users) or `waitForLogin()` (existing users) to poll until the session is confirmed.

## Implementation

<Tabs>
  <Tab title="React Native">
    ```typescript theme={null}
    import InAppBrowser from 'react-native-inappbrowser-reborn';

    const APP_SCHEME = 'your-app-scheme';

    // After authenticateWithEmailOrPhone resolves with passwordUrl or pinUrl in authStateInfo:

    // For new users creating a password
    if (authState.passwordUrl) {
      await InAppBrowser.openAuth(authState.passwordUrl, `${APP_SCHEME}://para`);
      await para.waitForWalletCreation({});
    }

    // For existing users logging in with password
    if (authState.passwordUrl) {
      await InAppBrowser.openAuth(authState.passwordUrl, `${APP_SCHEME}://para`);
      await para.waitForLogin({});
    }
    ```
  </Tab>

  <Tab title="Expo">
    ```typescript theme={null}
    import { openAuthSessionAsync } from 'expo-web-browser';

    const APP_SCHEME = 'your-app-scheme';

    // After authenticateWithEmailOrPhone resolves with passwordUrl or pinUrl in authStateInfo:

    // For new users creating a password
    if (authState.passwordUrl) {
      await openAuthSessionAsync(authState.passwordUrl, `${APP_SCHEME}://para`);
      await para.waitForWalletCreation({});
    }

    // For existing users logging in with password
    if (authState.passwordUrl) {
      await openAuthSessionAsync(authState.passwordUrl, `${APP_SCHEME}://para`);
      await para.waitForLogin({});
    }
    ```
  </Tab>
</Tabs>

<Info>
  The same pattern applies for PIN authentication. Replace `authState.passwordUrl` with `authState.pinUrl` depending on which method is configured for your API key.
</Info>

## Using with the State Listener

If you're using `authenticateWithEmailOrPhone()` with the `onStatePhaseChange` listener from the [authentication guide](/v3/react-native/guides/add-email-phone#handling-portal-urls), `passwordUrl` and `pinUrl` are already handled automatically. The listener opens these URLs when they appear in `authStateInfo`, so no additional code is needed.

## Next Steps

<CardGroup cols={3}>
  <Card title="Add Passkeys" imgUrl="/images/v3/general-passwords.png" href="/v3/react-native/guides/add-passkeys" description="Add native biometric authentication." />

  <Card title="Add Social Login" imgUrl="/images/v3/custom-ui-social.png" href="/v3/react-native/guides/add-social-login" description="Authenticate with Google, Apple, Discord, and more." />

  <Card title="EVM Integration" imgUrl="/images/v3/network-evm.png" href="/v3/react-native/guides/evm" description="Start signing transactions with EVM chains." />
</CardGroup>
