6

I'm working with Geoserver 2.12.1 (Windows Installer Version) and I had to enable CORS before for getting access when I attempted to do a GetFeatureInfo.

I did the steps to enable CORS:

  1. Edit webapps/geoserver/WEB-INF/web.xml:
<filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> <init-param> <param-name>allowedOrigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedMethods</param-name> <param-value>GET,POST,DELETE,PUT,HEAD,OPTIONS</param-value> </init-param> <init-param> <param-name>allowedHeaders</param-name> <param-value>origin, content-type, accept</param-value> </init-param> </filter> <!-- THIS FILTER MUST BE THE FIRST ONE, otherwise we end up with ruined chars in the input from the GUI See the "Note" in the Tomcat character encoding guide: http://wiki.apache.org/tomcat/FAQ/CharacterEncoding --> <filter-mapping> <filter-name>Set Character Encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> 

Now, the GetFeatureInfo for WMS Service is working, but, I recently installed WPS Plugin and when I do some request to:

http://localhost:8080/geoserver/wps

It's not working. It's showing the following error:

Failed to load resource: the server responded with a status of 403 (Forbidden) (index):1 Failed to load http://localhost:8080/geoserver/wps: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 403. 

But I have it configured to accept all methods.

What could be the reason?

2 Answers 2

0

You need to be an authorised user to to make WPS requests, so add a user name and password to the request. Admin/geoserver will work if you haven't set up any specific users and changed the default password.

0

Should enable access allowing domain in CSRF. Edit Geoserver´s web.xml and add comma separated allowed domains or IPs your server can be reached (Not client IPs).

<context-param> <param-name>GEOSERVER_CSRF_WHITELIST</param-name> <param-value>yourdomain.com,192.168.x.y</param-value> </context-param> 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.