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

question: Session expires in around 30 minutes, did I miss some configuration? #121

Closed
VTopoliuk opened this issue Jun 9, 2022 · 4 comments
Assignees
Labels
cookie question Further information is requested

Comments

@VTopoliuk
Copy link

A clear and concise description of what you want to accomplish.

I am trying to add reverse proxy to internal site and hide it behind auth. Everything works well except I need to relogin after every 30-60 minutes. I have tried to change cookie lifetime to different values, but as I can see it doesn't affect my case at all.

Am I missing something?

Configuration: local json file with single user + mfa

Config:

{
	order authenticate before respond
	order authorize before reverse_proxy

	security {
		local identity store localdb {
			realm local
			path /etc/caddy/users.json
		}

		authentication portal auth_portal {
			enable identity store localdb
			cookie domain mysecretdomain.com
			cookie lifetime 31536000 # 1 year
			transform user {
				match email vitalii@mysecretdomain.com
				action add role authp/user
			}

			transform user {
				match realm local
				require mfa
			}
		}

		authorization policy admin_policy {
			set auth url https://auth.mysecretdomain.com
			allow roles authp/user
		}
	}
}

auth.mysecretdomain.com {
	authenticate with auth_portal
}

voron24.mysecretdomain.com {
	authorize with admin_policy
	reverse_proxy 192.168.2.185
}
@VTopoliuk VTopoliuk added need triage question Further information is requested labels Jun 9, 2022
@greenpau
Copy link
Owner

greenpau commented Jun 9, 2022

@VTopoliuk , you are setting cookie lifetime, but not token lifetime. The cookie lifetime defines the lifetime of the cookie storing the actual token. You need to set the token lifetime too.

authentication portal myportal {
  crypto default token lifetime 3600
  cookie lifetime 7200

please see #24 (comment)

@VTopoliuk
Copy link
Author

Thank you a lot, I knew it was some stupid mistake!

@greenpau
Copy link
Owner

greenpau commented Jun 9, 2022

@VTopoliuk , please don’t hesitate asking questions. 😄

@greenpau
Copy link
Owner

@VTopoliuk , I am looking to add testimonial sections to https://authcrunch.com. Could you please write one and send it to me at greenpau@outlook.com?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cookie question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants