2

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.

1
  • Thank you for coming over from Stack Overflow. Please take our tour and tell us a bit about your Joomla journey in your profile. You might even like to give yourself a more "human" username.
    – mickmackusa
    Jul 14 '20 at 13:51
1

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.

4
  • @nikosidon I am new to this can you suggest me how can I overwrite com_users and mod_login module i.e where can I find these modules any resource or any help will be highly appreciated. Jul 14 '20 at 9:25
  • Welcome to Joomla! :) Start by reading docs.joomla.org/… for the template override implementation details. Due to the character count limits I will just point out the two files you need to override in your site's template. component/com_users/views/login/tmpl/default_login.php and modules/mod_login/tmpl/default.php
    – nikosdion
    Jul 15 '20 at 10:06
  • Thanks for your response, this helps a lot. Jul 23 '20 at 3:58
  • I am glad I could help you :) If you could please my answer as accepted it would be most helpful for other people coming by this thread. Have a great day!
    – nikosdion
    Jul 24 '20 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.