Sign-in
Username/password
The following example demonstrates a simple username/password sign-in flow.
Before you build your sign-in flow, you need to configure the appropriate settings in Clerk:
- Navigate to the Clerk Dashboard.
- In the navigation sidebar, select User & Authentication > Email, Phone, Username.
- In the Contact information section, ensure that only Password is enabled.
- In the Username section, ensure that Username is enabled.
Google OAuth
The following example demonstrates a simple Google OAuth sign-in flow.
Before you build your sign-in flow, you need to configure the appropriate settings in Clerk:
- Navigate to the Clerk Dashboard.
- In the navigation sidebar, select User & Authentication > Email, Phone, Username.
- Ensure that all settings are disabled.
- In the navigation sidebar, select Social Connections.
- Ensure that only Google is enabled.
Multi-factor authentication (MFA)
The following example demonstrates a simple multi-factor authentication (MFA) sign-in flow. The user can sign in with their email and password. If they have two-factor authentication enabled, they will need to verify their sign-in attempt with an SMS code.
Before you build your sign-in flow, you need to configure the appropriate settings in Clerk:
- Navigate to the Clerk Dashboard.
- In the navigation sidebar, select User & Authentication > Email, Phone, Username.
- Ensure that Email address, Phone number, and Password are enabled.
- Next to Phone number, select the settings icon and enable Require.
- In the navigation sidebar, select Multi-factor.
- Ensure that only SMS verification code is enabled.
Email + Google + MFA
The following example demonstrates a simple sign-in flow that combines email, Google OAuth, and multi-factor authentication (MFA). The user can sign in with their email and an email code, or with Google OAuth. If they have two-factor authentication enabled, they will need to verify their sign-in attempt with an SMS code.
Before you build your sign-in flow, you need to configure the appropriate settings in Clerk:
- Navigate to the Clerk Dashboard.
- In the navigation sidebar, select User & Authentication > Email, Phone, Username.
- In the Contact information section, ensure that only Email address and Phone number is enabled.
- Next to Phone number, select the settings icon and enable Require.
- In the Authentication strategies section, ensure that only Email verification code is enabled.
- In the navigation sidebar, select Social Connections.
- Ensure that only Google is enabled.
- In the navigation sidebar, select Multi-factor.
- Ensure that only SMS verification code is enabled.
Feedback
Last updated on