Hi,
I'm currently working on integrating cBioPortal with Keycloak as the identity provider. Here's what I've tried and the issues encountered:
1. Initial Attempt:I tried running cBioPortal over HTTP while Keycloak runs over HTTPS.
This setup failed due to CORS policy issues and protocol mismatch (HTTP vs HTTPS).
To resolve the protocol mismatch, I attempted to set up cBioPortal over HTTPS using Apache with mod_auth_mellon for SAML integration with Keycloak.
However, after redirection, the portal briefly loads then throws several errors:
{"req":{"method":"POST","url":"//servername/api/studies/tags/fetch","data":["lgg_ucsf_2014","msk_impact_2017"],"headers":{"accept":"application/json","content-type":"application/json"}},"xhr":{},"text":"Invalid CORS request","statusText":"","statusCode":403,"status":403,"statusType":4,"info":false,"ok":false,"redirect":false,"clientError":true,"serverError":false,"error":{"status":403,"method":"POST","url":"//servername/api/studies/tags/fetch"},"created":false,"accepted":false,"noContent":false,"badRequest":false,"unauthorized":false,"notAcceptable":false,"forbidden":true,"notFound":false,"unprocessableEntity":false,"headers":{"cache-control":"private, max-age=0, must-revalidate, no-cache, no-store, max-age=0, must-revalidate","connection":"Keep-Alive","date":"Fri, 11 Apr 2025 18:02:08 GMT","expires":"0","keep-alive":"timeout=5, max=97","pragma":"no-cache","server":"Apache/2.4.62 (Red Hat Enterprise Linux) OpenSSL/3.2.2","transfer-encoding":"chunked","vary":"Origin,Access-Control-Request-Method,Access-Control-Request-Headers","x-content-type-options":"nosniff","x-frame-options":"DENY","x-xss-protection":"0","content-type":null},"header":{"cache-control":"private, max-age=0, must-revalidate, no-cache, no-store, max-age=0, must-revalidate","connection":"Keep-Alive","date":"Fri, 11 Apr 2025 18:02:08 GMT","expires":"0","keep-alive":"timeout=5, max=97","pragma":"no-cache","server":"Apache/2.4.62 (Red Hat Enterprise Linux) OpenSSL/3.2.2","transfer-encoding":"chunked","vary":"Origin,Access-Control-Request-Method,Access-Control-Request-Headers","x-content-type-options":"nosniff","x-frame-options":"DENY","x-xss-protection":"0","content-type":null},"type":"","links":{},"body":null,"url":https://servername/}
"{\"req\":{\"method\":\"GET\",\"url\":\"//servrename/api/info\",\"headers\":{\"accept\":\"application/json\"}},\"xhr\":{},\"text\":\"<!DOCTYPE HTML PUBLIC \\\"-//IETF//DTD HTML 2.0//EN\\\">\\n<html><head>\\n<title>500 Internal Server Error</title>\\n</head><body>\\n<h1>Internal Server Error</h1>\\n<p>The server encountered an internal error or\\nmisconfiguration and was unable to complete\\nyour request.</p>\\n<p>Please contact the server administrator at \\n a...@abc.edu to inform them of the time this error occurred,\\n and the actions you performed just before this error.</p>\\n<p>More information about this error may be available\\nin the server error log.</p>\\n</body></html>\\n\",\"statusText\":\"Internal Server Error\",\"statusCode\":500,\"status\":500,\"statusType\":5,\"info\":false,\"ok\":false,\"redirect\":false,\"clientError\":false,\"serverError\":true,\"error\":{\"status\":500,\"method\":\"GET\",\"url\":\"//servername/api/info\"},\"created\":false,\"accepted\":false,\"noContent\":false,\"badRequest\":false,\"unauthorized\":false,\"notAcceptable\":false,\"forbidden\":false,\"notFound\":false,\"unprocessableEntity\":false,\"headers\":{\"access-control-allow-credentials\":\"true\",\"access-control-allow-headers\":\"Content-Type, Authorization, X-Requested-With, Accept\",\"access-control-allow-methods\":\"GET, POST, OPTIONS, DELETE, PUT\",\"access-control-allow-origin\":\"https://servername",\"connection\":\"close\",\"conten-length\":\"531\",\"content-type\":\"text/html; charset=iso-8859-1\",\"date\":\"Fri, 11 Apr 2025 18:09:21 GMT\",\"server\":\"Apache/2.4.62 (Red Hat Enterprise Linux) OpenSSL/3.2.2\"},\"header\":{\"access-control-allow-credentials\":\"true\",\"access-control-allow-headers\":\"Content-Type, Authorization, X-Requested-With, Accept\",\"access-control-allow-methods\":\"GET, POST, OPTIONS, DELETE, PUT\",\"access-control-allow-origin\":\"https://servername",\"connection\":\"close\",\"conten-length\":\"531\",\"content-type\":\"text/html; charset=iso-8859-1\",\"date\":\"Fri, 11 Apr 2025 18:09:21 GMT\",\"server\":\"Apache/2.4.62 (Red Hat Enterprise Linux) OpenSSL/3.2.2\"},\"type\":\"text/html\",\"charset\":\"iso-8859-1\",\"links\":{},\"body\":null}\n\n\n{\"req\":{\"method\":\"GET\",\"url\":\"//servername/api/cancer-types\",\"headers\":{\"accept\":\"application/json\"}},\"xhr\":{},\"text\":\"<!DOCTYPE HTML PUBLIC \\\"-//IETF//DTD HTML 2.0//EN\\\">\\n<html><head>\\n<title>500 Internal Server Error</title>\\n</head><body>\\n<h1>Internal Server Error</h1>\\n<p>The server encountered an internal error or\\nmisconfiguration and was unable to complete\\nyour request.</p>\\n<p>Please contact the server administrator at \\n a...@abc.edu to inform them of the time this error occurred,\\n and the actions you performed just before this error.</p>\\n<p>More information about this error may be available\\nin the server error log.</p>\\n</body></html>\\n\",\"statusText\":\"Internal Server Error\",\"statusCode\":500,\"status\":500,\"statusType\":5,\"info\":false,\"ok\":false,\"redirect\":false,\"clientError\":false,\"serverError\":true,\"error\":{\"status\":500,\"method\":\"GET\",\"url\":\"//servername/api/cancer-types\"},\"created\":false,\"accepted\":false,\"noContent\":false,\"badRequest\":false,\"unauthorized\":false,\"notAcceptable\":false,\"forbidden\":false,\"notFound\":false,\"unprocessableEntity\":false,\"headers\":{\"access-control-allow-credentials\":\"true\",\"access-control-allow-headers\":\"Content-Type, Authorization, X-Requested-With, Accept\",\"access-control-allow-methods\":\"GET, POST, OPTIONS, DELETE, PUT\",\"access-control-allow-origin\":\"https://servername",\"connection\":\"close\",\"conten-length\":\"531\",\"content-type\":\"text/html; charset=iso-8859-1\",\"date\":\"Fri, 11 Apr 2025 18:09:21 GMT\",\"server\":\"Apache/2.4.62 (Red Hat Enterprise Linux) OpenSSL/3.2.2\"},\"header\":{\"access-control-allow-credentials\":\"true\",\"access-control-allow-headers\":\"Content-Type, Authorization, X-Requested-With, Accept\",\"access-control-allow-methods\":\"GET, POST, OPTIONS, DELETE, PUT\",\"access-control-allow-origin\":\"https://servername",\"connection\":\"close\",\"conten-length\":\"531\",\"content-type\":\"text/html; charset=iso-8859-1\",\"date\":\"Fri, 11 Apr 2025 18:09:21 GMT\",\"server\":\"Apache/2.4.62 (Red Hat Enterprise Linux) OpenSSL/3.2.2\"},\"type\":\"text/html\",\"charset\":\"iso-8859-1\",\"links\":{},\"body\":null}"
I would like to find out any error resolution or steps to setup cbioportal to run on https, Idp will be keycloak after cbio running on https.
Thanks,
Harika
![]() | |
SECURITY_CORS_ALLOWED_ORIGINS=<allowed origins here, or “*">
--
You received this message because you are subscribed to the Google Groups "cBioPortal for Cancer Genomics Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cbioportal+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cbioportal/63da5e97-2388-41a0-8d75-d92f485c6310n%40googlegroups.com.
Yes, I have deployed cBioPortal using Docker Compose (version 6). Based on recommendations from previous posts, I am using Keycloak version 16.1.1, which is confirmed to be compatible.
To enable HTTPS, I’ve configured Apache with mod_auth_mellon. However, if cBioPortal has built-in support for HTTPS via its Spring Security framework, I would appreciate it if you could share any documentation or steps to configure it that way.
Once cBioPortal is running over HTTPS, I plan to integrate it with Keycloak(https) 16.1.1 as the identity provider.
SECURITY_CORS_ALLOWED_ORIGINS=*
![]() | |
To view this discussion visit https://groups.google.com/d/msgid/cbioportal/f9188dbf-d8b9-4d1f-be58-4b94d107f001n%40googlegroups.com.
Thanks, Benjamin. Setting SECURITY_CORS_ALLOWED_ORIGINS=* worked — cBioPortal is now running at https://test.edu.
I'm now trying to integrate cBioPortal (running on HTTPS) with Keycloak 16.1.1. However, I'm encountering an issue with the Valid Redirect URIs setting in Keycloak.
When I set the redirect URI as https://test.edu/*, I get the following error:
error=invalid_redirect_uriBut if I change it to http://test.edu/*, it works.
I'm not sure why the HTTPS URI fails, but I suspect it may be related to how the cBioPortal container is configured in docker-compose. Here's the relevant portion:
command: /bin/sh -c "rm -rf /cbioportal-webapp/lib/servlet-api-2.5.jar && java -Xms2g -Xmx4g -cp '/cbioportal-webapp:/cbioportal-webapp/lib/' org.cbioportal.PortalApplication --spring.config.location=cbioportal-webapp/application.properties --authenticate=saml --session.service.url=http://cbioportal-session:5001/api/sessions/my_portal/ --clickhouse_mode=${APP_CLICKHOUSE_MODE:-false} --spring.profiles.active=${APP_SPRING_PROFILE:-default}"Could the issue be due to the --session.service.url still using HTTP instead of HTTPS? Or is there something else I should check to ensure Keycloak accepts the HTTPS redirect?
Thanks,
Harika
To view this discussion visit https://groups.google.com/d/msgid/cbioportal/2a1cbcc8-955a-4f9a-b6cb-98989beb3df8n%40googlegroups.com.