Repository navigation
Reverse proxy setup cookie issue #40862
Before reporting an issue
AreaNo response Describe the bugHi, I'm using Keycloak for authentication and have set up a reverse proxy using Express.js. The redirection to my application port after login works successfully, but I'm immediately logged out afterward. It seems the issue is that cookies are not being set properly. below is my keycloak.conf setup my backend code: const resouceProxy = createProxyMiddleware({ const realmsProxy = createProxyMiddleware({ app.use('/auth', authProxy); frontend code: Version26.0.1 Regression
Expected behaviorMaintain the session as its when i logged IN to my application Actual behaviorWhen i logged in immediately its logged out when i checked authentication session cookies are not set properly How to Reproduce?after login Anything else?No response |
Replies: 2 comments 5 replies
|
These are either not used or no longer valid. proxy=edge Please set proxy-headers=xforwarded |
|
reverse proxy working as expected @shawkins Thank you for the help. |
I can help you resolve the basic issue of hostname / proxy configuration. You should be able to use hostname debug to confirm your new settings are correct: https://www.keycloak.org/server/hostname#_troubleshooting
From there if are not seeing insecure context warnings, then your issue lies elsewhere. We can then review your spi cookie settings, the proxy handling of cookies (for example #40111 (reply in thread)), and even the browser handling