cartalyst / sentinel

A framework agnostic authentication & authorization system.
BSD 3-Clause "New" or "Revised" License
1.51k stars 238 forks source link

cross-domain login functionality #575

Open akramwahid opened 3 months ago

akramwahid commented 3 months ago

I am encountering an authentication issue that involves cross-domain login functionality between two Laravel applications. Here's the breakdown of the scenario:

I have two sites under the same domain. The main site, built with Laravel 11 and utilizing Jetstream, resides in the root domain. Additionally, I have a shopping cart application that utilizes the Sentinel package and operates within a subdomain.

Both applications share the same database and user table. Therefore, when a user logs in to the main site, I expect them to be automatically logged in to the shopping subdomain or vice versa.

To achieve this, I have configured both applications with the same APP_KEY, SESSION_DOMAIN, and other relevant settings. Additionally, I have configured the session driver to use the database driver to ensure consistency across both sites.

However, despite these configurations, the cross-domain authentication feature does not function as expected. Upon investigation, I suspect that the issue arises from the difference in auth gurard drivers used by Jetstream's web guard (session driver) and the Sentinel package (sentinel driver).

I seek guidance on resolving this authentication issue and enabling seamless cross-domain login functionality between the two Laravel applications.