Skip to content

Comments

Fixing Cookie path#177

Merged
maikebing merged 1 commit intoIoTSharp:masterfrom
AT-WH:master
Feb 9, 2026
Merged

Fixing Cookie path#177
maikebing merged 1 commit intoIoTSharp:masterfrom
AT-WH:master

Conversation

@AT-WH
Copy link
Contributor

@AT-WH AT-WH commented Feb 9, 2026

I noticed that after removing my custom bindings I had made long time ago and switching fully to using AddSilkierQuartz middleware the authentication stopped working for me in production.

It seems like:

  • if base path is "/", then Cookie is set to "/quartz". That works, as entire app is hosted under "/quartz"
  • if base path is set to "/whatever" then app is offset and hosted under "/whatever/quartz", but the cookie is still set to "/quartz"

That clearly can't work. In this PR I've been trying to fix it.

Comment on lines +42 to +44
cfg.Cookie.Path = cookiePath;
cfg.LoginPath = $"{normalizedVirtualPath}Authenticate/Login";
cfg.AccessDeniedPath = $"{normalizedVirtualPath}Authenticate/Login";
Copy link
Contributor Author

@AT-WH AT-WH Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cookie path needs to be BasePath + QuatrzVirtualPath. Otherwise it doesn't grant access to the app.

@maikebing maikebing merged commit 02c72a2 into IoTSharp:master Feb 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants