1

I have been looking for readily available solutions to authenticate a user account to a Laravel application and the only things that I've come across in the general sense of authentication is LDAP, JWT, and oAuth. All that I have found so far was to use external services to log into the Joomla! install, rather than use Joomla! as a server itself.

Other than trying to sync user accounts (which would require issuing password resets for first-time users and may turn users away), what would be the best way to have existing Joomla! users log into a Laravel application?

3

as Valentin Despa say "I can imagine it could be quite easy to draft a solution where you expose an RESTful API via a component which allows you to authenticate the users."

A non REST solution is to use com_ajax with a custom plugin https://docs.joomla.org/Using_Joomla_Ajax_Interface

class plgAjaxMyauthentification extends JPlugin
{
    function onAjaxMyauthentification()
    {
    $jinput = JFactory::getApplication()->input;
    $password = $jinput->get('varname', null , 'STRING'); 
    $username = $jinput->get('varname', null, 'STRING');
    $result = JFactory::getApplication()->login(array('username'=>$username,    'password'=>$password));
    return $result;
    }
}

You can call this method with this url https://mysite.com/index.php?option=com_ajax&plugin=myauthentification&format=json&user=xxxxx&passsword=&&&

This code is a proof of concept. You need to add some security by using HTTPS connection and a HMAC token : http://culttt.com/2014/05/21/create-hmac-sha-authentication-implementation-php/

1

Your question is rather briefly formulated (feel free to elaborate) and does not give the exact context, but as far as I can tell, you want to manage your users with Joomla (for whatever reasons) and want to be able to authenticate.

Joomla does not offer out of the box an API to be able to authenticate the users.

I can imagine it could be quite easy to draft a solution where you expose an RESTful API via a component which allows you to authenticate the users.

Of course, things may get complicated as soon as you need to save things in the session...

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.