Skip to main content
Authenticate users with email or SMS one-time passwords (OTP).

Email Authentication

Rate Limits

Email verification is subject to the following rate limits:
  • 3 attempts per 10 minutes per email address
This is in place to protect deliverability of emails and to prevent abuse.

SMS Authentication

External JWT Authentication

For apps with existing authentication systems, you can authenticate users with an external JWT:

Passkey Authentication

Sign in with a passkey:
For more details on passkey management and setup, see the Passkeys documentation.

Authentication State

Monitor authentication state and get user information:

Built-in UI

The easiest way to add authentication is using the built-in UI which handles all authentication methods:

Best Practices

1. Error Handling

Always handle errors gracefully and provide clear feedback to users:

2. User Experience

  • Show loading states during authentication
  • Provide clear error messages
  • Allow users to resend OTP if needed
  • Display the email/phone where OTP was sent

3. Security

  • Never store OTP codes
  • Always use HTTPS connections
  • Implement proper session management
  • Handle token refresh automatically

Troubleshooting

OTP Not Received

  • Check that the email/phone number is valid
  • Look in spam folder for email OTP
  • Verify that the provider is enabled in Dynamic dashboard
  • Check rate limits haven’t been exceeded

Authentication Fails

  • Ensure OTP code is entered correctly
  • Check that the code hasn’t expired (codes typically expire after 10 minutes)
  • Verify network connectivity
  • Check for any error messages in Logcat

Session Not Persisting

  • Ensure you’re listening to authenticatedUserChanges flow
  • Verify that the SDK is properly initialized
  • Check that you’re not clearing app data

What’s Next

Now that you have authentication set up:
  1. Social Authentication - Add social login options
  2. Session Management - Manage authenticated sessions with Kotlin Flow
  3. Wallet Operations - Work with user wallets
  4. MFA - Add multi-factor authentication
Last modified on February 3, 2026