Appearance
Social Login
Sign-in with Google, GitHub, Facebook, Apple, Microsoft or LinkedIn on the site; the accounts are linked to WordPress users.
kitloom/ · admins: kitloom/, kitloom/
Video lessons
Recorded in the Filament admin; the Nova admin works the same way.
Sign-in with Google, GitHub, Facebook, Apple, Microsoft or LinkedIn on the site, as Nextend Social Login gives a WordPress site: a visitor presses "Continue with Google", comes back signed in. The account is linked to a WordPress user; a site that comes from WordPress with the plugin keeps every account its visitors linked there. The admin is kitloom/social-accounts-filament or kitloom/social-accounts-nova.
It is for the site's visitors. The admins keep their own sign-in.
Setting it up
Social Login → Settings, for each service:
- Make an OAuth app at the service (below).
- Give it the redirect URI the settings page shows:
https://,your- site/ auth/ google/ callback https://, … A site that moved from Nextend hadyour- site/ auth/ apple/ callback wp-there: add the new address (or replace the old one).login. php?login Social=google - Copy the app's id and secret into the settings and switch the service on.
A service shows a button only when it is switched on and has both keys (Apple: its team and key ids too). The secret is stored encrypted with the application key and never shown again; a field left empty keeps the saved one. If the application key changes, enter the secret again.
| Service | Where the app is made | What to copy |
|---|---|---|
| Google Cloud console → Create credentials → OAuth client ID → Web application | Client ID, client secret | |
| GitHub | Settings → Developer settings → OAuth Apps → New OAuth App | Client ID, client secret |
| Meta for Developers → My Apps → Create app, with the Facebook Login product; Settings → Basic | App ID, app secret. The redirect URI goes under Facebook Login → Settings → Valid OAuth Redirect URIs; the app must be live (or the visitor a tester) and ask for the email permission | |
| Apple | Certificates, Identifiers & Profiles: an App ID with Sign in with Apple, a Services ID configured for it with the site's domain and the redirect URI, and a Key for Sign in with Apple, downloaded once as a . file | Service ID (the identifier, site.), the . file's contents as the private key, the Team ID (top right of the account) and the Key ID |
| Microsoft | Microsoft Entra admin center → App registrations → New registration, a Web platform with the redirect URI; Certificates & secrets → New client secret | Application (client) ID, the secret's value. Tenant: empty is common (personal, work and school accounts); consumers is personal accounts only, organizations work and school, or the id of one directory — as the registration's Supported account types says |
| LinkedIn Developers → My apps → Create app, with the product Sign In with LinkedIn using OpenID Connect; Auth → Authorized redirect URLs | Client ID, client secret |
Apple signs the visitor in with a private key, not a secret from its console: the module makes the short-lived client secret Apple wants from the key on every trip, so nothing expires after six months as a hand-made one does. Apple sends the visitor back with a POST from its own site; the site takes it at the same address and goes on as with any other service. A visitor who hides their address gets one at Apple's private relay (…@privaterelay.): mail to it arrives only from a sender registered with Apple (Services → Sign in with Apple for Email Communication) — the site's mail domain.
Other settings:
| Setting | Default | What |
|---|---|---|
| Link accounts by email address | on | A visitor whose address at the service belongs to a user signs in as that user, and the account is linked. Only an address the service has verified counts, and only a user whose address is theirs: one who signed up on the site, or changed the address on the account page, opens a password reset link first |
| Login page | empty | The theme's page with the login form: a sign-in that went wrong comes back here. Empty — back to the page the button was pressed on |
New visitors become users only while Settings → General → «Anyone can register» is on, with the «New User Default Role». Otherwise only existing users can sign in this way.
Who signs in
When a visitor comes back from the service:
- The account is linked to a user — that user signs in.
- A user has the address the service vouches for — the account is linked to them and they sign in (unless linking by address is off). A user who typed that address in themselves at the site's sign-up, the shop's or the checkout's, or whose address was changed afterwards — on the account page, a profile page of an admin, or by an admin — is not joined until a password reset link sent there is opened (
kitloom_inemail_ unverified wp_,usermeta Kitloom\): whoever signed up first with someone else's address would otherwise share that person's account. Users an admin made, imported ones and those a service made keep linking as before.Wp Schema\ Users\ Email Proof - Registration is open — a new user is made from the account's name and address, and signs in.
- Otherwise the visitor goes back to the login page — or the page they pressed the button on — with a reason.
Which address a service vouches for: Google, Apple and LinkedIn say so of the one they give (email_); GitHub hands over the primary address only once verified, Facebook gives none until confirmed. Microsoft vouches for a personal account's address (Outlook, Xbox); a work or school account's address is whatever its directory says, and any directory may sign in through the common tenant, so such an address counts only when Entra vouches for the domain — add the optional claim xms_ to the app registration's ID token (Token configuration). Without it a work account signs in once linked, or once its user signed in with the password and linked it, and cannot sign up.
A user with two-factor authentication (kitloom/two-factor) still types the code: the sign-in waits for it, the visitor is sent to the code page. A social sign-in is remembered, as the plugin does.
A signed-in user who presses a button links that account to themselves; an account linked to someone else is refused. One account per service per user. A deleted user's accounts are deleted with them.
For the theme
GET /auth/google?redirect=/account/ the button: off to Google, back to /account/
GET /auth/google/callback where Google sends the visitor back
POST /auth/apple/callback where Apple sends the visitor back; sent on to the GET
DELETE /auth/google unlink from the signed-in user (JSON: {"unlinked": true})On a site in several languages (kitloom/languages) a button on a French page carries ?lang=fr: a visitor with no redirect comes back to the French front page, /, and a refusal comes back there too.
The buttons, with their addresses — for the services that are on:
php
use Kitloom\SocialAccounts\Facades\SocialLogin;
SocialLogin::buttons('/account/');
// [['provider' => 'google', 'label' => 'Google', 'url' => '…/auth/google?redirect=%2Faccount%2F',
// 'linked' => null, 'unlinkUrl' => null], …] linked: true/false for a signed-in user[nextend_ in content gives the theme the same buttons; provider="google,apple,facebook" picks and orders them, redirect is where to come back to, heading, style and align are passed as written.
Every page also carries the part social (Kitloom\): the same buttons, coming back to that page — for the theme's own sign-in form. The Vue themes here draw both: the shortcode in a page's text, the part under the sign-in form of the shop's account page (Pantry).
On the site's Account page (Settings → Reading, kitloom/site) a signed-in user has the section Linked accounts (?section=linked-) while a service is on: the same buttons in its data, coming back to the section.
What went wrong comes back as ?social_:
| Reason | What happened |
|---|---|
denied | The visitor cancelled at the service, or the sign-in was not started in this browser |
failed | The service could not be asked: wrong keys, no connection (the error is logged) |
no_ | A new visitor, and registration is closed |
no_ | A new visitor whose service gave no verified address |
email_ | A user has that address and it may not be linked by it: sign in with the password, then link the account |
linked_ | The account is linked to another user |
Where it is kept
| What | Where |
|---|---|
| Linked accounts | social_, Nextend Social Login's table (the site's table prefix in front): ID the user, type google, github, facebook, apple, microsoft, linkedin, identifier the account's id at the service, register_, login_, link_. Accounts of services the module does not know (X, Amazon) stay in the table and are listed |
| Settings | wp_: social_, …_, …_ (encrypted; Apple's private key), social_, social_, social_, social_, social_ |
| Model | Kitloom\; an application swaps it with Model |
Personal data
With kitloom/privacy, Tools → Export Personal Data lists the accounts linked to the user the address belongs to — the service, the account's id there, when it was linked, signed up with and last signed in with. Erase Personal Data unlinks them all: the rows go from social_, as when the user is deleted. The user stays and signs in with their password; pressing a button again links the account anew.
Configuration
php artisan vendor:: routes turns the addresses off, shortcodes. the shortcode, privacy. the personal data export and erasure, filament. and nova. the admins' sections.
Tests
From the application that installs the package: php vendor/.