# Authentication Methods

Openfort React Native supports multiple authentication methods. Choose the one that fits your app.

:::info
For an overview of all authentication methods and response types, see [Authentication methods](/docs/products/embedded-wallet/authentication).
:::

## Using Email Authentication

Use [`useEmailAuth`](/docs/products/embedded-wallet/react-native/hooks/useEmailAuth) for traditional email/password authentication. Supports sign up, login, password reset, and email verification.

```tsx
import { useEmailAuth } from "@openfort/react-native"

function EmailLogin() {
  const { signInEmail, signUpEmail, isLoading } = useEmailAuth()

  const handleSignIn = async () => {
    const result = await signInEmail({
      email: 'user@example.com',
      password: 'password123'
    })
    if (result.requiresEmailVerification) {
      // Prompt user to check inbox for verification code
    }
  }

  return (
    <Button
      title="Sign In"
      onPress={handleSignIn}
      disabled={isLoading}
    />
  )
}
```

[View full documentation →](/docs/products/embedded-wallet/react-native/hooks/useEmailAuth)

## Using Email OTP Authentication

Use [`useEmailAuthOtp`](/docs/products/embedded-wallet/react-native/hooks/useEmailAuthOtp) for passwordless email authentication. Users receive a one-time password via email.

```tsx
import { useEmailAuthOtp } from "@openfort/react-native"

function EmailOtpLogin() {
  const { requestEmailOtp, signInEmailOtp, isLoading } = useEmailAuthOtp()

  const handleRequestOtp = async () => {
    await requestEmailOtp({ email: 'user@example.com' })
  }

  const handleSignIn = async (otp: string) => {
    await signInEmailOtp({ email: 'user@example.com', otp })
  }

  return (
    <Button
      title="Send OTP"
      onPress={handleRequestOtp}
      disabled={isLoading}
    />
  )
}
```

[View full documentation →](/docs/products/embedded-wallet/react-native/hooks/useEmailAuthOtp)

## Using Phone OTP Authentication

Use [`usePhoneAuthOtp`](/docs/products/embedded-wallet/react-native/hooks/usePhoneAuthOtp) for passwordless phone authentication. Users receive a one-time password via SMS.

```tsx
import { usePhoneAuthOtp } from "@openfort/react-native"

function PhoneOtpLogin() {
  const { requestPhoneOtp, signInPhoneOtp, isLoading } = usePhoneAuthOtp()

  const handleRequestOtp = async () => {
    await requestPhoneOtp({ phone: '+1234567890' })
  }

  const handleSignIn = async (otp: string) => {
    await signInPhoneOtp({ phone: '+1234567890', otp })
  }

  return (
    <Button
      title="Send OTP"
      onPress={handleRequestOtp}
      disabled={isLoading}
    />
  )
}
```

[View full documentation →](/docs/products/embedded-wallet/react-native/hooks/usePhoneAuthOtp)

## Using Social Authentication

Use [`useOAuth`](/docs/products/embedded-wallet/react-native/hooks/useOAuth) for social login (Google, Facebook, Twitter, Apple) and account linking.

```tsx
import { OAuthProvider, useOAuth } from "@openfort/react-native"

function SocialLogin() {
  const { initOAuth, isLoading } = useOAuth()

  const loginWithGoogle = () => initOAuth({ provider: OAuthProvider.GOOGLE })

  return (
    <Button
      title="Sign in with Google"
      onPress={loginWithGoogle}
      disabled={isLoading}
    />
  )
}
```

[View full documentation →](/docs/products/embedded-wallet/react-native/hooks/useOAuth)

## Using Wallet Authentication

Use [`useWalletAuth`](/docs/products/embedded-wallet/react-native/hooks/useWalletAuth) to connect external wallets (MetaMask, WalletConnect, and others) with SIWE.

```tsx
import { useWalletAuth } from "@openfort/react-native"

function WalletLogin({ walletAddress }: { walletAddress: string }) {
  const { generateSiweMessage, signInWithSiwe, isLoading } = useWalletAuth()

  const startLogin = async () => {
    const { message } = await generateSiweMessage({
      wallet: walletAddress,
      from: { domain: 'example.com', uri: 'https://example.com' },
    })
    if (!message) return
    const signature = await signMessageWithWallet(message)
    await signInWithSiwe({ walletAddress, signature, messageOverride: message })
  }

  return (
    <Button
      title="Connect Wallet"
      onPress={startLogin}
      disabled={isLoading}
    />
  )
}
```

[View full documentation →](/docs/products/embedded-wallet/react-native/hooks/useWalletAuth)

## Using Guest Authentication

Use [`useGuestAuth`](/docs/products/embedded-wallet/react-native/hooks/useGuestAuth) for anonymous users and instant onboarding.

```tsx
import { useGuestAuth } from "@openfort/react-native"

function GuestLogin() {
  const { signUpGuest, isLoading } = useGuestAuth()

  return (
    <Button
      title="Try as guest"
      onPress={() => signUpGuest()}
      disabled={isLoading}
    />
  )
}
```

[View full documentation →](/docs/products/embedded-wallet/react-native/hooks/useGuestAuth)

## Using Your Own Authentication

Openfort supports integrating with external authentication providers like Firebase, Supabase, Auth0, and custom auth systems. This allows you to use your existing authentication while creating embedded wallets for users.

[View full documentation →](/docs/products/embedded-wallet/react-native/auth/third-party)
