# Social Login

## **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="/files/LADshm5MdquoHbt1V5bp" 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="/files/XbKbC1dGLm9CtNXLlZZm" 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="/files/to6OT61SIzl16do4oo24" 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!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webtonative.com/website-plugins/wordpress/social-login.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
