yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Authentication shared between sites on the same host

Open maxxer opened this issue 7 years ago • 6 comments

What steps will reproduce the problem?

  1. Configure two application on the same domain (i.e. localhost).
  2. Switch identity on one of the two application
  3. 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.

maxxer avatar May 07 '18 09:05 maxxer

Whenever I switch identity on Site A I get logged of on Site B (which is still running dektrium's tools!)

maxxer avatar May 07 '18 10:05 maxxer

Is this issue referring to 2 apps on:

  • different subdomains, i.e. one.localhost and two.localhost
  • main domain and it's subdomain, i.e. localhost and two.localhost
  • same exact domain or subdomain and different root in subfolder, i.e. localhost/one and localhost/two

?

ajmedway avatar May 08 '18 09:05 ajmedway

Last example, very same host and different subdir

maxxer avatar May 08 '18 10:05 maxxer

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?

ajmedway avatar May 08 '18 11:05 ajmedway

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

maxxer avatar May 08 '18 11:05 maxxer

I also believe is the expected behavior. Nevertheless, what's your proposed solution?

tonydspaniard avatar Jun 29 '19 07:06 tonydspaniard