Home > OS >  GCP External Global Load Balancer gives wrong user and password message while trying to login to Geo
GCP External Global Load Balancer gives wrong user and password message while trying to login to Geo

Time:07-30

I have an Ubuntu 22.04 VM on GCP, I installed Apache Tomcat 9 and downloaded Geoserver 2.21.0, at this point I am able to login with the external IP and port 8080.

After that, I created an external global load balancer in GCP and SSL certificate, to be able to get , and I am able to login with the external IP and port 8080, but not from the https site. While trying to make login I get an error about wrong username and password, at the same time I am able to login using the external IP and port 8080.

To solve this problem I modified the Global settings for my Geoserver and added my https address with /geoserver/ at the end as Proxy base URL, at this point I am able to login but if I try to save any changes I get the following error:

HTTP 400 – Bad Request Origin does not correspond to request The requirement sent by the client was syntactically incorrect Apache Tomcat/9.0.58 (Ubuntu)

The only way in which this problem will go away is to leave blank the Proxy base URL, but I am back to the first problem, of not being able to login trough the https address, only from the IP external address and port.

Has anybody had this problem and found a workaround? I have been reading the Geoserver documentation and a lot of forum posts but I have been unable to find a definitive solution.

CodePudding user response:

It sounds like you have a CSRF issue - see the documentation:

Symptoms of this problem may include the WPS request builder (and other wicket pages) failing with an HTTP status of 403 and the message “Origin does not correspond to request”. However, you may need to view the page response in a debugger to see this, to the end user it will appear as if the form section of the page is just missing.

The solution is

To allow-list your proxy with the CSRF filter, you can use the GEOSERVER_CSRF_WHITELIST property. This property is a comma-separated list of domains, of the form ., and can contain a subdomains. Each of these properties is set through one of the standard means:

  • web.xml

    <context-param>
      <param-name>GEOSERVER_CSRF_WHITELIST</param-name>
      <param-value>example.org</param-value>
    </context-param>
    
  • System property

    -DGEOSERVER_CSRF_WHITELIST=example.org

  • Environment variable

    export GEOSERVER_CSRF_WHITELIST=example.org

  • Related