4

I have Keycloak and Keycloak-Gatekeeper set up in OpenShift and it's acting as a proxy for an application that is running.

The application that Keycloak Gatekeeper is proxying requires a custom cookie to be set so I figured I could use the Gatekeeper's custom header configuration to set this however I'm running into issues.

Configuration looks like:

discovery-url: https://keycloak-url.com/auth/realms/MyRealm 
client-id: MyClient
client-secret: MyClientSecret
cookie-access-name: my.token
encryption_key: MY_KEY
listen: :3000
redirection-url: https://gatekeeper-url.com 
upstream-url: https://app-url.com 
verbose: true
resources:
- uri: /home/*
  roles:
    - MyClient:general-access
headers:
  Set-Cookie: isLoggedIn=true

After re-deploying and running through the auth flow, the upstream URL/application is not receiving the custom header. I tried with multiple headers (key/value) but can't seem to get it working or find where that header is being injected in the flow.

I've also checked logs and haven't been able to find anything super useful.

Sample Gatekeeper Config

Gatekeeper Custom Headers Docs

Any suggestions/ideas on how to get this working?

DanOpi
  • 133
  • 2
  • 12

1 Answers1

0

remove Set-Cookie.

Simply add

headers:
  isLoggedIn: true
Lou Bison
  • 11
  • 2