yii2-usuario
yii2-usuario copied to clipboard
Authentication shared between sites on the same host
What steps will reproduce the problem?
- Configure two application on the same domain (i.e.
localhost). - Switch identity on one of the two application
- Load the second application: auth is lost, probably because the switched user doesn't exist on this app.
What is the expected result?
Authentication should be application dependant, not related to hostname.
Whenever I switch identity on Site A I get logged of on Site B (which is still running dektrium's tools!)
Is this issue referring to 2 apps on:
- different subdomains, i.e.
one.localhostandtwo.localhost - main domain and it's subdomain, i.e.
localhostandtwo.localhost - same exact domain or subdomain and different root in subfolder, i.e.
localhost/oneandlocalhost/two
?
Last example, very same host and different subdir
Hmmm, this is the behaviour I would expect really, although I would expect different subdomains/domain in first 2 scenarios to see it as a different app, because client cookies are domain/subdomain-specific. Maybe we can configure an extra parameter to instruct Usuario module of the specific domain and url pattern for each configured app?
I'd use app id to generate a unique session identifier.
Maybe it's not a common case to have two apps on the same domain, but I don't see any drawback in adding this
I also believe is the expected behavior. Nevertheless, what's your proposed solution?