> For the complete documentation index, see [llms.txt](https://docs.webtonative.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webtonative.com/website-plugins/wordpress/social-login.md).

# WordPress Social Login Guide

Enable Google, Apple, and Facebook login with the WebToNative WordPress plugin for secure authentication in Android and iOS apps.

## **Webtonative Social Login Setup Guide**

**Prerequisites**

1. A WordPress site with admin access.
2. Google and Facebook developer accounts for setting up OAuth credentials.
3. The provided plugin code is installed and activated on your WordPress site.

***

#### **Configuration Steps**

<figure><img src="https://46162361-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbRbEDU7JrvMAgg52AY%2Fuploads%2FP7I8IHDxooKdYHVDrqWs%2FScreenshot%202025-01-06%20at%204.39.48%E2%80%AFPM.png?alt=media&amp;token=90e706a9-2170-4869-8b8f-fb1a18053c10" alt="" width="375"><figcaption></figcaption></figure>

**1. Setting Up Google Login**

1. **Create Google Credentials:**
   * Go to the [Google Cloud Console](https://console.cloud.google.com/).
   * Create a new project or select an existing one.
   * Navigate to **APIs & Services** > **Credentials**.
   * Click **Create Credentials** and select **OAuth Client ID**.
   * Configure the consent screen with the required details.
   * Choose **Web Application** as the application type and set the redirect URI as:

     ```
     https://your-site.com/wp-json/webtonative/social-login/verify/google
     ```
   * Save the credentials to get the `Client ID` and `Client Secret`.
2. **Add Credentials to WordPress:**

<figure><img src="https://46162361-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbRbEDU7JrvMAgg52AY%2Fuploads%2F50oouOAYbIvQFXccDyQa%2FScreenshot%202025-01-06%20at%204.39.15%E2%80%AFPM.png?alt=media&amp;token=2951a5a3-0044-4f2d-8409-63d309c808c9" alt=""><figcaption></figcaption></figure>

* In your WordPress admin panel, go to **Settings** > **Webtonative Social Login**.
* Enter the `Client ID` and `Client Secret` in the Google configuration section.
* Enable Google Login.

***

**2. Setting Up Facebook Login**

1. **Create Facebook App:**
   * Go to the [Facebook Developer Portal](https://developers.facebook.com/).
   * Create a new app or use an existing one.
   * Add the **Facebook Login** product to your app.
   * In the **Facebook Login** settings, add the redirect URI as:

     ```
     https://your-site.com/wp-json/webtonative/social-login/verify/facebook
     ```
   * Obtain the `App ID` and `App Secret` from the **Settings** > **Basic** section.
2. **Add Credentials to WordPress:**

<figure><img src="https://46162361-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbRbEDU7JrvMAgg52AY%2Fuploads%2FT9SBglUsMPl7DmmN9Vgw%2FScreenshot%202025-01-06%20at%204.39.05%E2%80%AFPM.png?alt=media&amp;token=3f9d0b71-08c0-48d0-982f-5e34ca265387" alt=""><figcaption></figcaption></figure>

* In your WordPress admin panel, go to **Settings** > **Webtonative Social Login**.
* Enter the `App ID` and `App Secret` in the Facebook configuration section.
* Enable Facebook Login.

***

**3. Setting Up Apple Login**

1. **Create Apple Service:**
   * Log in to the [Apple Developer Portal](https://developer.apple.com/).
   * Create an identifier for the app and configure it for **Sign in with Apple**.
   * Generate a private key for authentication and set the redirect URI as:

     ```
     https://your-site.com/wp-json/webtonative/social-login/verify/apple
     ```
   * Obtain the **Team ID**, **Key ID**, and **Client ID** (Bundle ID).
2. **Add Credentials to WordPress:**
   * In your WordPress admin panel, go to **Settings** > **Webtonative Social Login**.
   * Enter the **Team ID**, **Key ID**, and **Client ID** in the Apple configuration section.
   * Enable Apple Login.

***

#### **4. Testing the Social Login**

* Navigate to your WordPress site's login page.
* You should see buttons for Google, Facebook, and Apple login.
* Test each login method to ensure they redirect properly and create a new user or log in an existing user.

***

#### **5. Redirecting After Login**

* The plugin automatically redirects users to the configured redirect URI after a successful login.
* To set the redirect URI:
  * Go to **Settings** > **Webtonative Social Login**.
  * Enter the desired URL in the **Redirect URI** field.

***

#### **6. Troubleshooting**

* Ensure all redirect URIs match those specified in the respective developer platforms.
* Check your WordPress site's permalink settings. Enable **Pretty Permalinks** in **Settings** > **Permalinks**.
* If login fails, review error logs or the **OAuth Debugging Tools** provided by Google and Facebook.

***

#### **FAQs**

**Q: What if I don’t see the social login buttons?**\
Ensure the plugin is active and correctly configured.

**Q: How can I disable a specific social login?**\
Disable the corresponding option in **Settings** > **Webtonative Social Login**.

**Q: Can I use this for custom login pages?**\
Yes, but you might need to add the login buttons manually by editing your theme or using a shortcode.

***

This documentation should guide you through setting up and configuring social login for your WordPress site!
