Social Login
Instructions for implementing social login with the ParaSwift SDK.
Overview
This guide outlines how to implement social login (OAuth) with the ParaSwift SDK. It covers setup, authentication flow, and handling both new and existing user scenarios with providers like Google, Apple, and Discord.
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.
You must have the ParaSwift SDK installed and configured in your project. If you havenβt done this yet, please refer to our Quick Start Guide.
Environment Setup
Before implementing social login, ensure your environment is properly configured:
- Add the
webAuthenticationSession
environment value in your view - Add the
authorizationController
environment value for handling passkey operations after social login
Implementing Social Login
Setup
Create a view that will handle the social login process:
Initiating OAuth Authentication
To begin the OAuth flow with a specific provider, call the oAuthConnect
method:
Handling Authentication Result
After a successful OAuth connection, youβll need to handle both new and existing user scenarios:
Creating Social Login Buttons
Hereβs an example of how to create buttons for different OAuth providers:
Available OAuth Providers
The ParaSwift SDK supports the following OAuth providers:
- Google (
.google
) - Apple (
.apple
) - Discord (
.discord
)
Complete Example
Hereβs a complete example of a social login view:
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