Skip to main content
Topic: SSO - Google/Facebook - Social Login (Read 24 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SSO - Google/Facebook - Social Login

SSO / Social Login for ElkArte
Version: 1.0.0
Author: vbgamer45
Website: https://www.elkartemods.com/
Compatible with: ElkArte 1.1.0 - 1.1.99

================================================================================
 DESCRIPTION
================================================================================

SSO / Social Login adds OAuth 2.0 social login support to ElkArte. Users can
sign in or register with one click using their Google or Facebook account.
Buttons appear on the login and registration pages automatically.

Features:
  - Sign in with Google
  - Sign in with Facebook
  - Auto-links existing accounts by matching email address
  - Optional auto-registration for new users
  - Extensible provider architecture (add new providers easily)
  - Admin panel for managing settings and provider credentials
  - Profile page showing linked SSO accounts with unlink option
  - CSRF-protected OAuth flow with server-side token exchange
  - Styled login buttons with official provider branding

================================================================================
 REQUIREMENTS
================================================================================

  - ElkArte 1.1.x
  - PHP 7.0 or higher
  - PHP cURL extension enabled
  - SSL/HTTPS recommended (required by most OAuth providers)

================================================================================
 INSTALLATION
================================================================================

  1. Download the package zip file
  2. Go to Admin > Packages > Install a New Package
  3. Upload and install the package
  4. Navigate to Admin > Configuration > SSO / Social Login
  5. Enable SSO and configure at least one provider (see below)

================================================================================
 CONFIGURATION
================================================================================

After installation, go to Admin > Configuration > SSO / Social Login.

SETTINGS TAB:
  - Enable SSO / Social Login: Master on/off switch
  - Auto-register new users: When enabled, users signing in via SSO who don't
    have a matching forum account will have one created automatically

PROVIDERS TAB:
  Configure each OAuth provider with credentials from their developer console.
  Step-by-step setup instructions are shown for each provider.

  Google Setup:
    1. Go to https://console.cloud.google.com/apis/credentials
    2. Create a project and OAuth 2.0 Client ID (Web application type)
    3. Add the Redirect URI shown in the admin panel to Authorized redirect URIs
    4. Copy the Client ID and Client Secret into the admin panel
    5. Configure the OAuth consent screen with your forum name

  Facebook Setup:
    1. Go to https://developers.facebook.com/apps/
    2. Create an app (Consumer or Business type)
    3. Find App ID and App Secret under Settings > Basic
    4. Go to Facebook Login > Settings
    5. Add the Redirect URI shown in the admin panel to Valid OAuth Redirect URIs
    6. Copy the App ID and App Secret into the admin panel
    7. Set the app to Live mode for production use

================================================================================
 HOW IT WORKS
================================================================================

  1. User clicks "Sign in with Google" (or Facebook) on the login page
  2. User is redirected to the provider's consent screen
  3. After authorization, the provider redirects back to your forum
  4. The mod checks for a matching account:
     a. If the SSO identity is already linked -> logs in
     b. If the email matches an existing member -> links and logs in
     c. If no match and auto-register is on -> creates account and logs in
     d. If no match and auto-register is off -> shows error with instructions

  Users can view and unlink their SSO accounts from their profile.

================================================================================
 ADDING NEW PROVIDERS
================================================================================

The mod uses an extensible provider architecture. To add a new provider
(e.g. Discord):

  1. Create SSOProviderDiscord.php in SUBSDIR extending the SSOProvider class
  2. Implement all abstract methods (getName, getAuthorizationUrl, etc.)
  3. Register it in SSO.subs.php in the sso_get_providers() function
  4. Add language strings and admin settings for the new provider

================================================================================
 UNINSTALLATION
================================================================================

  1. Go to Admin > Packages
  2. Find SSO / Social Login and click Uninstall
  3. The package will remove hooks, source files, and template modifications
  4. Optionally removes the database table and settings (you will be prompted)

================================================================================
 CHANGELOG
================================================================================

Version 1.0.0
  - Initial release
  - Google OAuth 2.0 provider
  - Facebook OAuth 2.0 provider
  - Auto-registration support
  - Admin configuration panel
  - Profile linked accounts management

================================================================================
 SUPPORT
================================================================================

For support, bug reports, or feature requests visit:
https://www.elkartemods.com/

================================================================================
 LICENSE
================================================================================

Copyright (c) 2025 vbgamer45 - https://www.elkartemods.com/
All rights reserved.
Like Like x 1 

An Error Has Occurred

Undefined array key "awepost_text_viewlist"
 
Simple Audio Video Embedder