Overview
Social login (OAuth) is integrated directly into Para’s unified authentication experience. This guide covers how to implement social login alongside email and phone authentication in a single, streamlined interface. Para supports Google, Apple, and Discord as OAuth providers.Prerequisites
Prerequisites
To use Para, you need an API key. This key authenticates your requests to Para services and is essential for integration.Don’t have an API key yet? Request access to the Developer Portal to create API keys, manage billing, teams, and more.
Unified Authentication Approach
Para’s recommended approach is to integrate social login directly into your main authentication view alongside email and phone options. This provides users with all authentication methods in one place.Environment Setup
Ensure your authentication view has access to the required environment values:Implementing Social Login
Integration with Unified Auth View
Social login should be integrated alongside email and phone authentication in your main authentication view. Here’s a basic example:Handling Social Login
Implement the social login handler that manages the OAuth flow:handleOAuth
method:
- Authenticates the user with the OAuth provider
- Checks if a Para account exists for the user
- For new users: creates a Para account and sets up a passkey automatically
- For existing users: logs them in directly
- Returns nothing on success, throws errors on failure
Creating Social Login Buttons
Create buttons for each OAuth provider:Available OAuth Providers
The ParaSwift SDK supports the following OAuth providers:- Google (
.google
) - Apple (
.apple
) - Discord (
.discord
)
Key Points
- Social login is handled through the
handleOAuth
method - The method manages the complete OAuth flow including user authentication, Para account creation/lookup, and passkey setup for new users
- For existing users, it logs them in directly
- The SDK supports Google, Apple, and Discord as OAuth providers
- Social login should be integrated with email/phone authentication for a unified experience
Next Steps
After implementing social login, you might want to:- Set up email verification for new users
- Implement secure storage for session management
- Add biometric authentication as an additional security layer