MyListing Apple Sign In
The {CODICTS} MyListing Apple Sign In plugin adds Sign in with Apple functionality to your MyListing site’s login and registration forms. Users can authenticate with their Apple ID using a popup-based flow — no full-page redirects required.
The plugin automatically injects a styled “Sign in with Apple” button into MyListing’s login containers. It handles the complete authentication process: opening the Apple Sign-In popup, verifying the authorization server-side with Apple, and either logging in an existing user or creating a new WordPress account.
Requirements
A paid Apple Developer Program membership ($99/year)
Installation & Activation
Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.
After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.
After activation, navigate to Apple Sign In in the admin sidebar to configure your Apple Developer credentials before the button will appear on your site.
Key Features
| Feature | Description |
|---|---|
| Apple Sign In Button | Automatically injects a styled “Sign in with Apple” button into MyListing’s login and registration forms. |
| Popup-Based Authentication | Uses Apple’s JavaScript SDK with a popup window — no full-page redirects, so users stay on your site. |
| Server-Side Verification | Authorization codes are verified server-side with Apple’s token endpoint for security. |
| Automatic User Creation | New users get a WordPress account created automatically on first Apple Sign-In. |
| Existing User Linking | If a user already has an account with the same email, their Apple ID is linked automatically. |
| MyListing Role Support | Respects MyListing’s primary and secondary user role system during registration. |
| Social Login Compatibility | Works alongside other CoDicts social login plugins (Facebook, LinkedIn, etc.). |
| Enable/Disable Toggle | Quickly turn the feature on or off from the settings page. |
How It Works
When a visitor who is not logged in views a page with a MyListing login form, the plugin injects a “Sign in with Apple” button. Clicking it opens an Apple Sign-In popup where the user authenticates with their Apple ID (Face ID, Touch ID, or password).
After successful authentication, the plugin verifies the credentials server-side with Apple, then resolves the user account using a three-step process:
| Step | Lookup | Result |
|---|---|---|
| 1 | Search for a user already linked to this Apple ID | If found, logs them in immediately. |
| 2 | Search for a user with the same email address | If found, links their Apple ID to the existing account and logs them in. |
| 3 | No matching user found | Creates a new WordPress account with the Apple-provided details and logs them in. |
After login, the user is redirected back to the page they came from.
Apple’s privacy feature: Users can choose to hide their real email via Apple’s Private Email Relay. In this case, a unique
@privaterelay.appleid.comaddress is used. The plugin handles this transparently — everything works normally with the relay email.
Apple Developer Setup Guide
Before the plugin can work, you must create credentials in the Apple Developer Portal. This is a one-time setup.
Step 1: Create an App ID
1. In the Apple Developer Portal, go to Certificates, Identifiers & Profiles → Identifiers.
2. Click + to register a new identifier. Select App IDs and continue.
3. Enable the Sign in with Apple capability.
4. Note your Team ID — visible in the top-right of the developer portal or under Membership. It’s a 10-character alphanumeric string.
Step 2: Create a Services ID (Client ID)
1. Go to Identifiers → click +. Select Services IDs and continue.
2. Provide a description and a unique identifier (e.g., com.yoursite.signin) — this becomes your Client ID.
3. Enable Sign in with Apple and click Configure:
| Field | What to Enter |
|---|---|
| Domains and Subdomains | Your site’s domain without http:// or https:// (e.g., yoursite.com) |
| Return URLs | Your site’s full home URL (e.g., https://yoursite.com) |
4. Save.
Tip: The plugin’s settings page displays the exact values you need for “Domains and Subdomains” and “Return URLs” based on your WordPress site URL. You can copy them directly.
Step 3: Create a Private Key
1. Go to Keys → click +.
2. Name the key and enable Sign in with Apple. Click Configure and select your primary App ID.
3. Click Register and download the .p8 key file.
4. Note the Key ID displayed after registration.
Important: You can only download the private key file once. Store it securely. If you lose it, you’ll need to create a new key.
Step 4: Configure the Plugin
In the WordPress admin under Apple Sign In, enter the credentials from the previous steps:
| Field | Value |
|---|---|
| Client ID | Your Services ID identifier (e.g., com.yoursite.signin) |
| Team ID | Your Apple Developer Team ID (10-character string) |
| Key ID | The Key ID of the private key you created |
| Private Key | The full contents of the .p8 file, including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines |
Enable the “Apple Sign In Enabled?” checkbox and save. The “Sign in with Apple” button will now appear on your login forms.
Admin Settings Page
Navigate to Apple Sign In in the WordPress admin sidebar.
| Field | Description |
|---|---|
| Apple Sign In Enabled? | Master toggle to enable or disable the Sign in with Apple button on your site. |
| Domains and Subdomains | Read-only helper field showing the value to enter in Apple’s configuration (your domain without protocol). |
| Return URLs | Read-only helper field showing the value to enter in Apple’s Return URLs (your full site URL). |
| Client ID | Your Apple Services ID identifier. |
| Team ID | Your Apple Developer Team ID. |
| Key ID | The identifier of the private key you registered with Apple. |
| Private Key | The full PEM-encoded contents of the .p8 key file. |
New User Registration
When someone signs in with Apple for the first time and no matching account exists, the plugin creates a new WordPress user:
| Detail | How It’s Set |
|---|---|
| Username | Taken from the email prefix (before @). If already taken, a random suffix is appended (e.g., john_A3X9). |
| The email provided by Apple (or the Private Relay address if the user hides their email). | |
| First/Last Name | From Apple, if provided. Apple only sends the name on the first authorization — it’s stored for future reference. |
| Password | A random 16-character password is generated. The user can reset it later if needed. |
| Role | Respects MyListing’s role system. If secondary roles are enabled and the user selects one, that role is used. Otherwise defaults to customer. |
Name on first auth only: Apple only provides the user’s first and last name the very first time they authorize your app. On subsequent sign-ins, the name fields are empty. The plugin saves the name on first auth so it’s available for the user’s profile.
Example Setup
1. Create an App ID, Services ID, and Private Key in the Apple Developer Portal following the setup guide above.
2. In WordPress, go to Apple Sign In in the admin sidebar.
3. Copy the Domains and Subdomains and Return URLs values shown on the settings page into your Apple Services ID configuration.
4. Enter your Client ID, Team ID, Key ID, and paste the full Private Key contents.
5. Check “Apple Sign In Enabled?” and save.
6. Visit any page with a MyListing login form. The “Sign in with Apple” button appears automatically alongside any other social login buttons.
7. Click the button to test. The Apple popup opens, you authenticate, and you’re logged in and redirected back to the page.
Frequently Asked Questions
Do I need an Apple Developer account?
Yes. A paid Apple Developer Program membership ($99/year) is required to create the Services ID, Private Key, and other credentials needed for Sign in with Apple.
Does this require a child theme?
No. The plugin works via script injection and does not modify any theme files.
Where does the button appear?
The button is automatically injected into all MyListing login and registration forms (any element matching div.login-container). No manual placement is needed.
Can users register via Apple Sign-In, or only log in?
Both. If no existing user matches the Apple account ID or email, a new WordPress account is created automatically.
What role is assigned to new users?
The plugin respects MyListing’s role configuration. If secondary roles are enabled and the user selects one on the registration form, that role is used. Otherwise, the default customer role is assigned.
What happens if a user hides their email with Apple’s privacy feature?
Apple provides a unique Private Relay email address (e.g., xyz@privaterelay.appleid.com). The plugin uses this as the user’s email and everything works normally.
What if someone already has an account with the same email?
The plugin detects the existing account by email, links the Apple ID to it, and logs the user in. No duplicate account is created.
Does the page redirect after sign-in?
Yes. After successful authentication, the user is redirected to the page they came from, or the site home page if no referrer is available.
Can I use this alongside other social login plugins?
Yes. The plugin is designed to coexist with other CoDicts social login plugins (Facebook, LinkedIn, etc.). It detects existing social login wrappers and adds the Apple button alongside other providers.
What is the Client ID?
The Client ID is the identifier of the Services ID you create in the Apple Developer Portal (e.g., com.yoursite.signin). It is not the App ID.
Where do I find my Team ID?
Your Team ID is visible in the top-right corner of the Apple Developer Portal or under Membership details. It’s a 10-character alphanumeric string.
Does my site need HTTPS?
Yes. Apple Sign-In requires your site to be served over HTTPS. Apple will reject authentication attempts from non-HTTPS domains.
What happens when I deactivate the plugin?
The Apple Sign-In button is removed from login forms. Existing user accounts and their linked Apple IDs (stored in user meta) are preserved. Users can still log in with their username and password. Reactivating restores the Apple button.
Troubleshooting
Apple Sign-In Button Not Appearing
| Cause | Solution |
|---|---|
| Plugin not enabled | Go to Apple Sign In settings and make sure the “Apple Sign In Enabled?” checkbox is checked. |
| Client ID not configured | The button only appears when a valid Client ID is entered in the settings. |
| User already logged in | The button only appears for visitors who are not logged in. |
| No login form on the page | The button is injected into MyListing’s .login-container elements. Verify the page has a MyListing login form. |
| Plugin not activated | Go to Plugins → Installed Plugins and verify the plugin is active. |
Authentication Fails with “Cannot open private key”
| Cause | Solution |
|---|---|
| Incomplete private key | Make sure you’ve pasted the full contents of the .p8 file, including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines. |
| Wrong key format | The private key must be in PEM format (the format of the .p8 file Apple provides). Do not modify or reformat the key. |
| PHP OpenSSL not available | The ES256 signing requires PHP’s OpenSSL extension. Contact your hosting provider to ensure it’s enabled. |
Authentication Fails with “Invalid request”
| Cause | Solution |
|---|---|
| Expired nonce | The page may have been open too long. Refresh the page and try again. |
| Plugin disabled | Check that “Apple Sign In Enabled?” is turned on in settings. |
Apple Popup Blocked by Browser
| Cause | Solution |
|---|---|
| Browser popup blocker | The Apple Sign-In popup may be blocked by the browser. Users need to allow popups for your site, or click the popup notification in their browser’s address bar. |
Authentication Fails with No Clear Error
| Cause | Solution |
|---|---|
| Wrong Client ID | Verify the Client ID matches your Services ID identifier in the Apple Developer Portal (not the App ID). |
| Domain mismatch | The domain configured in Apple’s Services ID must match your site’s domain exactly. Check the “Domains and Subdomains” and “Return URLs” in Apple’s Web Authentication Configuration. |
| Wrong Team ID or Key ID | Double-check these values against your Apple Developer Portal account. |
| PHP cURL not available | The plugin requires PHP’s cURL extension to communicate with Apple’s servers. Contact your hosting provider. |
New User’s Name Not Saved
| Cause | Solution |
|---|---|
| Not the first authorization | Apple only provides the user’s name the very first time they authorize your app. If they previously authorized it (even during testing), the name won’t be sent again. To reset, the user can go to Apple ID Settings → Sign in with Apple on their Apple device, remove your app, and re-authorize. |
“MyListing Theme Not Detected” Error
The MyListing theme must be installed and active. Go to Appearance → Themes to verify.
For further support, visit codicts.com or contact us at support@codicts.com.