Appearance
Are you an LLM? You can read better optimized documentation at /flows/admin/AD-44-social-auth-settings.md for this page in Markdown format
Social Auth Settings
Flow ID: AD-44 | Module(s): settings | Complexity: Low Last Updated: 2026-04-04
Business Context
Social auth settings allow Advisable-level administrators to configure OAuth login providers (Google and Facebook) for the storefront. When enabled, customers can sign in or register using their Google or Facebook accounts instead of creating a traditional email/password account.
The configuration stores OAuth client credentials (client IDs, secrets, project IDs) in the registry and provides enable/disable toggles for each provider independently.
API Reference
REST Endpoints
No REST API. Social auth settings are managed through the legacy admin settings panel.
Legacy Admin Routes
| Route | Controller | Method | HTTP | Description |
|---|---|---|---|---|
settings/social_auth | AdvSocialAuthSettings | index | GET | Display settings form |
settings/social_auth | AdvSocialAuthSettings | index | POST | Save settings and redirect |
Code Flow
Viewing Settings
- Admin navigates to
settings/social_auth. AdvSocialAuthSettings::index()callsview().view()loads current values from the registry:- Google: login enabled flag, project ID, client ID, client secret (encrypted).
- Facebook: login enabled flag, app ID, app secret (encrypted).
- Renders
settings/social_authview with current values pre-filled.
Saving Settings
- Admin submits the form with updated values.
index()detects POSTsubmitand callspost().post()runsvalidation()which appliestrimrules to all fields (no required fields).- If validation passes, calls
registry->setValue()for each field:SOCIAL_AUTH / GOOGLE_LOGIN_ENABLED-- cast to int (0/1)SOCIAL_AUTH / GOOGLE_PROJECT_IDSOCIAL_AUTH / GOOGLE_CLIENT_IDSOCIAL_AUTH / GOOGLE_CLIENT_SECRET-- stored encrypted (trueflag onsetValue)SOCIAL_AUTH / FACEBOOK_LOGIN_ENABLED-- cast to int (0/1)SOCIAL_AUTH / FACEBOOK_CLIENT_IDSOCIAL_AUTH / FACEBOOK_CLIENT_SECRET-- stored encrypted (trueflag onsetValue)
- Redirects to
settings/social_auth.
Domain Layer
No modern domain layer. Settings are stored in the registry pattern.
Architecture
| Component | Path | Purpose |
|---|---|---|
AdvSocialAuthSettings | ecommercen/settings/controllers/AdvSocialAuthSettings.php | Admin controller (93 lines) |
| Registry | application/libraries/Registry.php | DB-backed key-value store |
| Auth library | ecommercen/auth/libraries/ | Consumes these settings for OAuth flows |
Data Model
No dedicated tables. All data stored in the registry table via the Registry pattern.
Registry Keys
| Group | Key | Type | Description |
|---|---|---|---|
SOCIAL_AUTH | GOOGLE_LOGIN_ENABLED | int | 0=disabled, 1=enabled |
SOCIAL_AUTH | GOOGLE_PROJECT_ID | string | Google Cloud project ID |
SOCIAL_AUTH | GOOGLE_CLIENT_ID | string | Google OAuth client ID |
SOCIAL_AUTH | GOOGLE_CLIENT_SECRET | string (encrypted) | Google OAuth client secret |
SOCIAL_AUTH | FACEBOOK_LOGIN_ENABLED | int | 0=disabled, 1=enabled |
SOCIAL_AUTH | FACEBOOK_CLIENT_ID | string | Facebook App ID |
SOCIAL_AUTH | FACEBOOK_CLIENT_SECRET | string (encrypted) | Facebook App secret |
Configuration
| Source | Key | Description |
|---|---|---|
| Registry | SOCIAL_AUTH group | All OAuth credentials and enable flags |
Required roles: AUTH_ROLE_ADVISABLE only (highest privilege level -- not available to regular admins).
Encrypted storage: Client secrets are stored with encryption via the registry's $encrypted = true parameter on setValue() and value().
Client Extension Points
- Override controller: Create
Social_auth_settingsinapplication/modules/settings/controllers/to add additional providers or validation rules. - Custom providers: Add new OAuth providers by extending the controller and adding corresponding registry keys and auth library integration.
Business Rules
- Advisable-only access: Only users with
AUTH_ROLE_ADVISABLEcan access this settings page. Regular admins cannot modify OAuth credentials. - Independent toggles: Google and Facebook can be enabled/disabled independently.
- Encrypted secrets: Client secrets are stored encrypted in the registry to prevent exposure in DB dumps.
- No required fields: All fields use only
trimvalidation -- the form can be submitted with empty values (effectively disabling the provider). - Immediate effect: Changes take effect immediately after save -- no cache invalidation needed since registry values are read on each request.
Related Flows
- AD-13 Settings -- Parent settings module
- AD-01 Admin Auth -- Admin authentication system
- CF-10 Customer Auth -- Storefront customer login where social auth is used
Wiki Guide: Social Auth Guide -- developer reference for social authentication setup