Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cookie based auth on subdomain #5

Open
goofballtech opened this issue Oct 13, 2017 · 1 comment
Open

cookie based auth on subdomain #5

goofballtech opened this issue Oct 13, 2017 · 1 comment
Labels

Comments

@goofballtech
Copy link

goofballtech commented Oct 13, 2017

It's me again from #1

I have been using your plugin successfully for sub directories as we discussed. Now i would like to tyr to apply it to a subdomain and the syntax is kicking my butt.

this is what i have currently. Have tried it a few different ways but the below is the longest form of what was attempted so everything is there. I know if just going to be a syntax error, just don't know what it might be.

sonarr.domain.com {

	proxy / 127.0.0.1:8989 {
		transparent
	}
	
	proxy /auth-admin https://domain.com/Organizr/auth.php?admin
	proxy /auth-user https://domain.com/Organizr/auth.php?user
	reauth {
		path /
		failure redirect target=https://domain.com/organizr
		upstream url=https://domain.com/organizr/auth-admin,cookies=true
	}
}

edit* when i click on the link it always redirects no matter what. If i pull the reauth block though it loads as expected.

@freman
Copy link
Owner

freman commented Oct 18, 2017

Is the cookie you're setting being set with a domain?

eg

Set-Cookie: name=value; domain=.domain.com
vs
Set-Cookie: name=value

If it's not being set with .domain.com the browser won't send it to the subdomain

Altho, there seems to be some difference of opinion on whether the . is required or detrimental

https://stackoverflow.com/questions/18492576/share-cookie-between-subdomain-and-domain

@freman freman added the moreinfo label Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants