Thanks for providing those debug logs! The error “No pre-authenticated principal found in request” from CCSMAuthenticationCookieFilter indicates that Optimize is not receiving or recognizing the authentication cookie after the Keycloak login process.
Since you’ve confirmed the redirect URLs are correctly configured, this is likely a cookie handling issue. Here are the specific solutions to try:
Cookie Configuration Fix
The most common cause of this specific error is the SameSite cookie setting. You need to disable SameSite cookies for Optimize:
Add this to your Optimize configuration:
environment:
- CAMUNDA_OPTIMIZE_SECURITY_AUTH_COOKIE_SAME_SITE_ENABLED=false
Or in Helm values:
optimize:
env:
- name: CAMUNDA_OPTIMIZE_SECURITY_AUTH_COOKIE_SAME_SITE_ENABLED
value: "false"
This is especially important when using ingress controllers or reverse proxies, as they can interfere with cookie handling in cross-site scenarios.
Additional Checks
1. Issuer URL Consistency
Verify that the issuer URL in your Optimize configuration exactly matches what Keycloak provides:
# Should match your Keycloak realm issuer URL
CAMUNDA_OPTIMIZE_IDENTITY_ISSUER_URL: "https://your-keycloak-domain/auth/realms/your-realm"
2. Client Secret Configuration
Ensure your Optimize client in Keycloak is:
Enabled
Access Type: confidential
Valid client secret provided to Optimize
3. Protocol Consistency
Make sure all URLs (Keycloak, Optimize, Identity) use the same protocol (HTTPS recommended).
Debugging Steps
- Check browser network tab during login to see if cookies are being set
- Verify cookie domain/path settings in browser dev tools
- Enable more detailed logging for authentication:
logging: level: com.camunda.optimize.service.security: DEBUG org.springframework.security: DEBUG
Most Likely Solution
Based on the specific error you’re seeing, setting CAMUNDA_OPTIMIZE_SECURITY_AUTH_COOKIE_SAME_SITE_ENABLED=false should resolve the issue. This is a common requirement for Optimize when using external OIDC providers like Keycloak.
Try this configuration change first and let me know if the redirect loop persists!
References: