OAuth Social Logins
Add social login options to your Para integration
Para supports various OAuth methods to authenticate users across different platforms. Currently supported platforms include Google, Facebook, Discord, Twitter, and Apple.
Para automatically links wallets with a common email identifier to avoid creating duplicate wallets if users choose different methods in different sessions. Because of this, users must have an email associated with their login account of choice. Without an email linked to the account, authentication will fail and the user will see a prompt to either add email to their social account or try a different method.
Integrating Social Logins
You have two options when for using social logins with Para. You can use the Para Modal and simply pass in your desired OAuth methods, or you can use the SDK to manually control the OAuth process and create your own custom UI.
Para Modal
Social Logins can be easily integrated via the ParaModal
component by passing the desired options as an array to the
oAuthMethods
property:
Configure OAuth Methods
[Object.values(OAuthMethod)]
to get all the available OAuth methods as an array. Custom OAuth Implementation
For developers implementing their own authentication UI, Para provides methods to handle OAuth authentication and subsequent wallet creation.
Handle OAuth Authentication
This implementation provides a complete OAuth flow, from initial authentication through wallet creation and recovery secret generation. For best practice and ease of use, you can split the code into separate functions for each new user creation flow, login flow, and wallet creation flow.
Beta Testing Email In the BETA
Environment, you can use any email ending in @test.getpara.com
(like
dev@test.getpara.com). Any OTP code will work for verification with these test emails. These credentials are for beta
testing only. You can delete test users anytime in the beta developer console to free up user slots.
Farcaster Authentication
Farcaster authentication follows a similar pattern but uses Farcaster-specific methods. Here’s how to implement a complete Farcaster authentication flow:
Telegram OAuth Login
To implement your own Telegram authentication flow, please refer to the official documentation. Para uses the following bots to handle authentication requests:
Environment | Username | Bot ID |
---|---|---|
DEV | @para_oauth_dev_bot | 8145911241 |
SANDBOX | @para_oauth_sandbox_bot | 7552159413 |
BETA | @para_oauth_beta_bot | 7788006052 |
PROD | @para_oauth_bot | 7643995807 |
When you receive an authentication payload, you can use para.verifyTelegram()
to validate the payload hash and either
find or create the Para user for that Telegram user ID, all in one step. As with Farcaster, these users will not have an
associated email or phone number and will thereafter need to use Telegram to sign in to your app.
With these implementations, you can seamlessly integrate OAuth social logins into your application with your own custom UI.
Examples
For an example code implementation of the above custom OAuth methods check out this simple React + Next.js application:
You’ll also find custom Phone and Email authentication examples in the same repository.
Next Steps
If you’re building your own custom UI you can also add a custom phone authentication and email authentication flow to your Para integration. Check out the guides below to learn more: