TransWikia.com

Using hooks in Joomla to add a Single Sign-On link in main page of Joomla

Joomla Asked by user11034850 on September 5, 2021

I have implemented SSO (Single Sign-On) in Joomla using OKTA and now my goal is to add a link in the main login page of Joomla using hooks.

To do this, I have added one checkbox in the service provider tab of Joomla and one column in the database to determine whether the checkbox is checked or not. If checked it will give a 1 value in the table otherwise false.

Now I have to add a link in the main page using hooks such that a like will be displayed if the value is 1 in the database; otherwise no link.

And I cannot find a function or class where I can do this same task.

NOTE: I cannot modify the login.php of the Joomla default template.
The plugin which I am using right now is miniOrange’s SAML SSO plugin.

One Answer

The easiest way to do what you are trying to accomplish is with template overrides, not plugin events (we don't call them "hooks" in Joomla). Ideally, you'd need to make a template override for com_users' login view and the mod_login module to make sure that both places where a user can log in are covered.

The reason I'm not recommending a plugin event is that Joomla 3 does not yet have a plugin event to add additional login buttons / links to the login page. This feature was added in Joomla 4 with my contribution of the WebAuthn plugin. The idea behind adding those events was your use case: Single Sign On implementations. But that's besides the point since Joomla 4 is still in beta.

As a side note, I wouldn't modify Joomla's database tables. It's not necessary. You can store additional per-user information in the #__user_profiles table. This is a more forward-looking approach, meaning that upgrading your site to Joomla 4 in a few months won't break your SSO implementation.

Answered by nikosdion on September 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP