Social Login
This documentation provides a detailed guide on integrating and managing social login authentication using OAuth providers such as Google, Facebook, and Twitter. Each section covers a specific aspect, including API endpoints, admin panel management, and frontend implementation.
Admin Panel UI
- Navigate to Settings -> Social Login in the admin panel.
- Enter the Client ID, Client Secret, and Callback URL for each provider.
- Click Submit to save the credentials.
- If a provider is missing credentials, the login button for that provider will not be displayed on the user authentication page.
1. Overview
Social login allows users to authenticate using their existing accounts from third-party providers. This enhances the user experience by reducing the need for manual registration and password management.
Supported providers:
2. Obtaining OAuth Credentials
Each provider requires an application to be registered in their developer portal. Follow these steps to obtain OAuth credentials for each platform.
Google OAuth Credentials
- Visit the Google Developer Console.
- Create a new project or select an existing one.
- Navigate to APIs & Services → Credentials.
- Click Create Credentials and select OAuth Client ID.
- Configure the OAuth Consent Screen (if not already set up).
- Choose Web Application as the application type.
- Set the Authorized Redirect URIs:
https://yourdomain.com/auth/google/callback
- Copy the Client ID and Client Secret.
Facebook OAuth Credentials
- Visit the Facebook Developers Portal.
- Create a new app and choose Consumer as the app type.
- Enable Facebook Login and configure its settings.
- Add the Valid OAuth Redirect URIs:
https://yourdomain.com/auth/facebook/callback
- Navigate to Settings → Basic and copy the App ID and App Secret.
Twitter OAuth Credentials
- Visit the Twitter Developer Portal.
- Create a new project and an application.
- Navigate to Keys and Tokens.
- Generate and copy the API Key, API Secret Key, and Bearer Token.
- In Authentication Settings, set the callback URL:
https://yourdomain.com/auth/twitter/callback
3. Frontend Implementation
Social login buttons are dynamically displayed based on available credentials.
Example Login Form with Dynamic Buttons:
Authentication All API endpoints are authenticated using Bearer tokens and picked up from the specification file. More details in the API Reference section