To avoid the popup (challenge) you have to send the Http Header Authorization
which each request. Look here for an example http://www.avajava.com/tutorials/lessons/how-do-i-connect-to-a-url-using-basic-authentication.html Christian Zitat von Meichun Li <pcloudy2...@yahoo.com>: > Hi, > > My web application uses Struts Framework, and the enviroments are > JDK 6,Tomcat 6, GeoServer 2.2.2. > > I configured GeoServer to secure WMS, a basic authencitation window > pops up for WMS request. For example, user name and password > are required to input to access > http://localhost:8080/geoserver/topp/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:states&styles=&bbox=-124.73142200000001,24.955967,-66.969849,49.371735&width=780&height=330&srs=EPSG:4326&format=application/openlayers > In my web application, I don't want to pass username and password in > the URL string, instead, I want to access the secured WMS without > authentication window. > I used ol4jsf proxy but it doesn't work, the autentication window > still pops up. > > Please see below for my set up. Is there something wrong? > > In my JSP page, I do the WMS request such as these: > untiled = new OpenLayers.Layer.WMS( > "topp:states - Untiled", > "http://localhost:8080/geoserver/topp/wms", > { > LAYERS: 'topp:states', > STYLES: '', > format: format > }, > { > singleTile: true, > ratio: 1, > isBaseLayer: true, > yx : {'EPSG:4326' : true} > } > ); > > I put ol4jsf-core-2.5.0.jar in my application WEB-INF/lib floder and > create ol4jsf-proxy.xml in WEB-INF/classes: > > <?xml version="1.0" encoding="UTF-8"?> > <ol4jsf-proxy> > <use-environment id="desenv" /> > <environment id="desenv"> > <description>Development Environment.</description> > <resources> > <resource name="wms"> > <url>http://http:localhost:8080/geoserver/wms</url> > <authentication> > <username>admin</username> > <password>geoserver</password> > </authentication> > </resource> > </resources> > </environment> > </ol4jsf-proxy> > > In my web application web.xml page, I added these: > > <!-- Proxy for GeoServer WMS--> > > <servlet> > <servlet-name>OL4JSFProxy</servlet-name> > <servlet-class>org.ol4jsf.proxy.servlet.OL4JSFProxy</servlet-class> > <load-on-startup>0</load-on-startup> > </servlet> > <servlet-mapping> > <servlet-name>OL4JSFProxy</servlet-name> > <url-pattern>/OL4JSFProxy/*</url-pattern> > </servlet-mapping> > > Any suggestions are highly appreciated. > Thanks! > Maggie > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users