Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

social login guide #338

Merged
merged 16 commits into from
Nov 19, 2024
7 changes: 7 additions & 0 deletions docs/links/Facebook_developer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from . import link

link_name = "Facebook developer"
link_text = "Facebook developer"
link_url = "https://developers.facebook.com/products/facebook-login/"

link.xref_links.update({link_name: (link_text, link_url)})
7 changes: 7 additions & 0 deletions docs/links/Linkedin_developer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from . import link

link_name = "LinkedIn developer"
link_text = "LinkedIn developer"
link_url = "https://www.bing.com/ck/a?!&&p=b2b85466e898e3f3JmltdHM9MTcyODQzMjAwMCZpZ3VpZD0wZmNhOGE5ZC05ODA0LTY0OGYtMjVhYy05ZWQwOTk2MzY1NjYmaW5zaWQ9NTE5Mg&ptn=3&ver=2&hsh=3&fclid=0fca8a9d-9804-648f-25ac-9ed099636566&psq=linkedin+developer+app&u=a1aHR0cHM6Ly9kZXZlbG9wZXIubGlua2VkaW4uY29tLw&ntb=1"

link.xref_links.update({link_name: (link_text, link_url)})
7 changes: 7 additions & 0 deletions docs/links/X-developer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from . import link

link_name = "X-developer"
link_text = "X-developer"
link_url = "https://developer.twitter.com/en/portal/petition/essential/basic-info/"

link.xref_links.update({link_name: (link_text, link_url)})
Binary file added docs/plugins/images/API_key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plugins/images/Call_back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plugins/images/adding_social_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 74 additions & 4 deletions docs/plugins/social_login.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,80 @@
.. vale off
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Social Login
RitaOC marked this conversation as resolved.
Show resolved Hide resolved
#############
############

.. image:: images/twilio-sid-authtoken.png
With Mautic's Social Login, users can easily sign in via their favorite social platforms like Twitter, Facebook, or LinkedIn. The social login feature automatically pre-fills forms with profile data and updates or creates new contacts in Mautic, streamlining the user experience.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Before You Begin: Setup Requirements
RitaOC marked this conversation as resolved.
Show resolved Hide resolved
------------------------------------
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Before enabling social login, make sure you have created social media apps on the platforms you want to integrate:
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

- :xref:`X-developer`
- :xref:`Facebook developer`
- :xref:`LinkedIn developer`

Once these apps are set up, you're ready to connect them to Mautic!
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Step 1: Authorizing Social Media Plugins
RitaOC marked this conversation as resolved.
Show resolved Hide resolved
----------------------------------------
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Before you can use social login, each social media plugin needs authorization. Here’s how to do it:
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

1. **Copy the Callback URL**: Go to Mautic's plugin configuration window and copy the Callback URL provided there. Paste it into the appropriate field in your social app setup.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

.. image:: images/Call_back.png
:width: 400
:alt: Screenshot of the SID and Auth Token fields
:alt: Screenshot of a call back url input field.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

2. **Add Your API Keys**: Copy the API Key (Client Key) and API Secret (Client Secret) from the social platform. Paste these keys into the relevant fields in the Mautic plugin configuration.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

.. image:: images/API_key.png
:width: 400
:alt: Screenshot of an API Key input field.

3. **Authorize the Plugin**: In the Mautic plugin configuration, click **Authorize**. Ensure the plugin is marked as **Published** by toggling the option to “Yes”. Finally, save your configuration to complete the setup.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

.. Tip:: You can manage each social network under its respective tab in Mautic’s plugin settings. Make sure each network is fully authorized by adding the required API credentials.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Step 2: Adding Social Login Buttons to Forms
RitaOC marked this conversation as resolved.
Show resolved Hide resolved
--------------------------------------------
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Once your plugins are authorized, you can add social login buttons to your Mautic forms.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

1. Go to the Forms section in Mautic and either create a new form or edit an existing one.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

2. Select the **Social Login** field from the form builder. Buttons for all authorized social platforms (e.g., Twitter, Facebook, LinkedIn) will automatically appear.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

3. When users log in using their social accounts, Mautic will attempt to automatically fill in fields like **Name** or **Email** based on their social profile.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

.. image:: images/adding_social_login.png
:alt: Mautic plugin configuration screen showing authorized status
RitaOC marked this conversation as resolved.
Show resolved Hide resolved
:width: 400

.. note::
Only the buttons for plugins you’ve authorized will work in the form. Ensure all integrations are configured correctly for a smooth user experience.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Step 3: Configuring Features and Mapping Contact Fields
RitaOC marked this conversation as resolved.
Show resolved Hide resolved
-------------------------------------------------------
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Once the plugin is authorized, you can customize how Mautic handles the incoming social profile data. Under the **Contact Field Mapping** tab in the plugin settings, map the fields from the user’s social profile (e.g., Email, Name) to the appropriate Mautic contact fields.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

- You only need to map fields that are relevant to your form.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

- Unmapped fields will not be used to update or create contacts in Mautic.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Example: Map **First Name** from Facebook to **First Name** in Mautic's contact fields.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Supported Social Profile Fields
RitaOC marked this conversation as resolved.
Show resolved Hide resolved
-------------------------------
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

Each platform provides different user data fields. Here's a quick reference of the fields you can map:

fakela marked this conversation as resolved.
Show resolved Hide resolved
- **Twitter**: Profile Handle, Name, Location, Description, URL, Time Zone, Language, Email.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

- **Facebook**: First Name, Last Name, Name, Gender, Locale, Email, Profile Link.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

- **LinkedIn**: First Name, Last Name, Maiden Name, Formatted Name, Headline, Location, Summary, Specialties, Positions, Public Profile URL, Email Address.
RitaOC marked this conversation as resolved.
Show resolved Hide resolved

.. vale on
.. vale on
Loading