Skip to content

Overview of the Social Login system

Nicholas K. Dionysopoulos edited this page Apr 22, 2022 · 4 revisions

The extensions

Akeeba Social Login consists entirely of plugins.

The main extension is the System - Akeeba Social Login plugin. This is the brains of the system. In Joomla 3 it handles rendering of the login, link/unlink buttons and all low level tasks. In Joomla 4 it conveys the login button information to Joomla itself, renders the link/unlink buttons in the user profile page and handles low level tasks. This plugin must be published and its Access set to Public for SocialLogin to work at all.

There are also one or more plugins in the sociallogin group. These are the integrations. They contain the plumbing required to bridge Joomla! with a social network (e.g. Facebook) or a remote login service. Each one of these plugins conveys the information required to render a login, link or unlink button for a specific login system and handles the login system-specific actions which make logging in possible.

At the bare minimum you need to publish the System - Akeeba Social Login plugin and one or more sociallogin plugins.

How does it work

By default, the system plugin injects the Social Login buttons into two places, login modules and the user profile edit pages.

Joomla 3

Login buttons are injected into the login modules, after the end of the rest of their content. These buttons let users login with their social network accounts. Depending on your settings, a new user account may be created if the user tries to log in with a social network account that's not yet linked to any other Joomla! user account. By default only Joomla's mod_login gets login buttons appended to it.

Account link / unlink buttons are rendered in the Joomla! user profile edit page. These buttons let the user link their Joomla! account to a social media account or, if it's already linked, unlink it. Please note that ONLY the profile edit pages of Joomla's com_users component get these buttons injected into them. Third party solutions such as Community Builder will NOT get these buttons injected into them.

ATTENTION! We strongly recommend AGAINST using the automatic button injection, especially for the login modules. The automatic button injection is quite dumb, adding buttons at awkward positions unless you are making pretty basic use of the Joomla! built-in login modules. We instead recommend that you integrate with template overrides.

Joomla 4

Login buttons are rendered by Joomla itself, using the new “additional login buttons” feature introduced in Joomla 4 as part of the WebAuthn integration. SocialLogin's system plugin gathers the information from the sociallogin plugins and conveys them to Joomla through the onUserLoginButtons event. The Joomla core or third party code consuming this even is solely responsible for rendering the login buttons. Joomla itself renders these buttons in the login module and the login page of the Users component in the frontend of the site, as well as the backend login module. These buttons let users login with their social network accounts. Depending on your settings, a new user account may be created if the user tries to log in with a social network account that's not yet linked to any other Joomla! user account.

Account link / unlink buttons are rendered in the Joomla! user profile edit page. These buttons let the user link their Joomla! account to a social media account or, if it's already linked, unlink it. This happens by SocialLogin's system plugin extending the front- and backend user profile form through the onContentPrepareData event. This means that only the core Joomla users component will see these buttons. If you are using a third party component, such as Community Builder, to display a user profile page you will need to integrate SocialLogin into it with template overrides.

Redirection after login

Joomla 3

After logging in you will be redirected to the last page of the site you visited before logging in. This may be different than the page you are currently using the login buttons on. For example, if you opened five tabs, closed the last four and then used the social login button on the original tab you will NOT be redirected back to that page. You will be redirected to the page the last (fifth) tab had open. This is a limitation of social networks / third party authentication providers and the way Joomla's session works.

You can override the login redirection location when using an integration with template overrides. However, if you have more than one places on the page where the social login buttons appear, only the last integration rendered by Joomla will be effective. Joomla does NOT necessarily render its components, modules and templates in the same order they are displayed. Components are rendered first, including their template overrides. Modules are rendered next, when the site's template is being parsed. The order they are rendered depends on the template's implementation. Buttons created through the system plugin are the last thing to happen. Always try to only display one login area. If that's not possible remember that this may cause redirection issues on your site.

For further information please consult issue #70 which gives deeper insight on the subject.

Finally, do note that this is not a bug or something that can change. It's how Joomla and external services work.

Joomla 4

If the login button is in a login module or login page which has a URL to redirect to after logging in then this is where you will be redirected. Otherwise, SocialLogin will redirect you to the last page of the site you visited before logging in. This may be different than the page you are currently using the login buttons on. For example, if you opened five tabs, closed the last four and then used the social login button on the original tab you will NOT be redirected back to that page. You will be redirected to the page the last (fifth) tab had open. This is a limitation of social networks / third party authentication providers and the way Joomla's session works.

You cannot override the redirection URL with template overrides anymore. This is due to the way Joomla's additional login buttons work.

Documentation of the extensions

You can find more information on setting up and using the Social Login extensions in the following pages: