Skip to main content

Overview

Social authentication allows users to sign in to your app using their existing social media accounts. The Dynamic Swift SDK supports multiple providers including Google, Apple, and Farcaster.

Prerequisites

1. Dynamic Console Configuration

Before implementing social authentication, you must enable and configure the desired providers in your Dynamic Console:
  1. Log in to Dynamic Console
  2. Navigate to Log in and User Profile → Social
  3. Enable the providers you want to support
  4. Configure OAuth settings for each provider
Register your app’s redirect URL in the Dynamic Console:
  1. Go to Dynamic Console
  2. Navigate to Security → Whitelist Mobile Deeplink
  3. Add your app’s deep link URL (e.g., yourapp://)
  4. Save the configuration

3. Info.plist Configuration

Add the following to your Info.plist to ensure authentication callbacks work properly:

Implementation

Social Login with Providers

Use the sdk.auth.social.connect() method to authenticate with social providers:

Supported Providers

The SDK supports the following social providers:

Complete Social Authentication Example

Here’s a complete example showing how to implement social authentication in a SwiftUI view:

Listening for Authentication State

After social authentication succeeds, use the Combine publisher to handle the authenticated user:

Best Practices

  • Use a consistent deep link URL format
  • Ensure the URL is whitelisted in your Dynamic Console
  • Test deep link handling in your app
  • Make sure the redirectUrl in ClientProps matches your URL scheme

2. User Experience

  • Show loading states during authentication
  • Provide clear error messages
  • Handle user cancellation gracefully

3. Security

  • Never store sensitive authentication data
  • Use secure network connections
  • Implement proper session management

Troubleshooting

Callback Not Working

  • Verify your app’s URL scheme is configured correctly in Info.plist
  • Check that the redirectUrl in ClientProps matches your URL scheme
  • Ensure your deep link URL is whitelisted in Dynamic Console

Provider Not Working

  • Confirm provider is enabled in Dynamic Console
  • Check that OAuth settings are properly configured
  • Verify you have the correct permissions/scopes configured

Authentication Fails

  • Check network connectivity
  • Verify provider credentials in Dynamic Console
  • Ensure the user’s account with the provider is valid
  • Check for any error messages in the console
Last modified on October 29, 2026