Social Login Authentication
Social login authentication allows users to authenticate using OAuth providers like Google, Facebook, or custom providers through Auth0. There are two authentication flows available:
- Redirect flow: Redirects the user to the provider’s login page and back to your application
- Popup flow: Opens the provider’s login page in a popup window without leaving your application
React
React Native
JavaScript
Prerequisites
Before implementing social login in your application, you need to configure your Smart Wallets dashboard and application:
-
Follow the Setup Instructions in the Getting Started Guide:
- See the Getting Started with Authentication page for complete setup instructions
- Pay special attention to the social authentication provider configuration and whitelisted origins setup
-
Key Configuration Requirements:
- Enable desired social providers in your Smart Wallets dashboard
- Add your application’s domain to the whitelisted origins
- Set
enablePopupOauth: true
in your config if using popup flow
Implementation Options
You can implement Social Login authentication in two ways:
- Pre-built UI Components - Quick implementation with minimal code
- Custom UI - Complete control over the user experience
Pre-built UI Components
Smart Wallets provides pre-built UI components that handle the entire Social Login authentication flow with minimal code.
Step 1: Add Authentication Components to Your Page
Before configuring your authentication, first add one of the pre-built components to your application:
Using Modal Authentication
To add authentication in a modal popup:
For more details on modal configuration, see the Modal Authentication documentation.
Or:
Using Embedded Authentication
To embed authentication directly in your page:
For more details on embedded authentication, see the Embedded Authentication documentation.
Step 2: Configure Social Login in UI Components
After adding the components, configure the Social Login authentication in your application config:
Custom UI
If you need complete control over the user experience, you can implement your own custom UI for Social Login authentication using Smart Wallets hooks.
Step 1: Configure Your Application
Before implementing social login, make sure you’ve:
- Set up your authentication providers in the Smart Wallets dashboard
- If using popup flow, set
enablePopupOauth: true
in your Account Kit configuration
Step 2: Implement the Authentication
Create buttons or UI elements for each social provider you want to support:
Next Steps
Enabling Authenticator App (TOTP) MFA
If you want to require a second factor for Social Login, see Social Login with Multi-Factor Authentication. Once users have set up a TOTP-based authenticator app, they’ll be prompted for their 6-digit code automatically.
Custom Social Providers
For custom OAuth providers like GitHub, Twitter, etc., see the Custom Social Providers documentation.