LDAP authentification does not trigger onUserLogin-event?

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Post Reply
User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

LDAP authentification does not trigger onUserLogin-event?

Post by carsten888 » Thu Jul 18, 2019 9:22 am

The Joomla core plugin LDAP authentification does not seem to trigger the onUserLogin-event from the user-plugins. This is needed for redirection on login.

When using the Joomla authentification, the event is triggered and all works fine. When using the LDAP plugin the whole event is ignored.

Might be the same for the gmail authentification plugin.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

mbabker
Joomla! Hero
Joomla! Hero
Posts: 2209
Joined: Sun Feb 28, 2010 8:26 pm

Re: LDAP authentification does not trigger onUserLogin-event?

Post by mbabker » Thu Jul 18, 2019 12:59 pm

The authentication plugins are not responsible for dispatching any of the user events for successful or failed login. That's all done in the application class. You will need to step through the LDAP plugin to see if it is doing something to short circuit the request cycle (which would prevent the follow-on events from being dispatched) or step through Joomla\CMS\Application\CMSApplication::login() to determine if the event is properly being dispatched or if not why it wouldn't be (which could mean checking the Joomla\CMS\Authentication\Authentication class for any concerns, as well as other authentication plugins).

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: LDAP authentification does not trigger onUserLogin-event?

Post by carsten888 » Thu Jul 18, 2019 1:18 pm

The authentication plugins are not responsible for dispatching any of the user events for successful or failed login. That's all done in the application class.
Yes thats what I came to as well. The Joomla authentification plugin also has no code to trigger an event, just return the login status and message.
You will need to step through the LDAP plugin to see if it is doing something to short circuit the request cycle (which would prevent the follow-on events from being dispatched)
To make sure I make a test-authentification plugin which just returns true. It did fire, but the user was not logged in. So yes, got to be something else then the authentification plugins, deeper in the Joomla system.

So I guess this is a Joomla bug.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 25943
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: LDAP authentification does not trigger onUserLogin-event?

Post by Per Yngve Berg » Thu Jul 18, 2019 3:57 pm

The plugin must return username, full name and email in order to log the user in.

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: LDAP authentification does not trigger onUserLogin-event?

Post by carsten888 » Thu Jul 18, 2019 4:13 pm

Per Yngve Berg wrote:
Thu Jul 18, 2019 3:57 pm
The plugin must return username, full name and email in order to log the user in.
you are right. It does login like that.

Code: Select all

class PlgAuthenticationTest extends JPlugin
{
	
	public function onUserAuthenticate($credentials, $options, &$response)
	{
		
		$response->type = 'test';		
		$response->email = 'ikjhbjlhb@ljblbljbljbkjbljhb.nl';
		$response->fullname = 'qq';
		$response->language = '';
		$response->status = JAuthentication::STATUS_SUCCESS;
		$response->error_message = '';		
		
		return true;
	}	
	
}
OK. And with the above basic stripped down plugin, it also does the redirect. So I guess there is something wrong in the Joomla core LDAP plugin. But I can't find what that is.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...


Post Reply

Return to “Joomla! 3.x Bug Reporting”