I'm trying to find a way to use the Joomla extension Hikashop
in parallel with another external website built with Laravel.
I'm using :
- Laravel 5.5
- Joomla 3.8.x
Here is how the setup looks (extremely simplified) :
___________________________ ________________
|Joomla server with Hikashop| <---- API calls ----> | Laravel server |
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
To get products, prices, purchases etc. all is done through API request to the Joomla website using the com_api
component and a custom plugin that returns everything I need.
For user consistency, whenever a user is created, modified or deleted on Laravel, the user is created, modified or deleted on Joomla.
Note 1 : The user cannot edit his profile on Joomla so the sync is only one way.
Note 2 : The login should only be on the Laravel website
Here is the problem i can't get around : on the Laravel website, when the user wants to buy a product, he is redirected to the Joomla website to access the Hikashop interface and pay for the product. This creates multiple questions :
Question 1 : Since the user is on Laravel, he has not session yet on Joomla. How do you pre-create the Joomla session using an API so that when the user arrives on Joomla he is already logged in ?
Question 2 : Once the payment is made, how do you redirect the user the the previous page on Laravel ? (The trigger is good, the only issue is passing the "origin" URL around)
I've tried looking into SSO (Single Sign On) but i would like to keep the two systems separated.
Thank you in advance if you have any ideas or ways to pass session + data from one website to another !