Skip to main content

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 to create API keys, manage billing, teams, and more.
You must have the ParaSwift SDK installed and configured in your project. If you haven’t done this yet, please refer to our .

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 can access the system authentication helpers and register the default web session once:

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:
The 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
  • Uses the default WebAuthenticationSession you registered; pass a custom one only if you need to override it for a specific call.

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:
  1. for new users
  2. for session management
  3. as an additional security layer