<div>Hello all,</div><div><br></div><div>I'm trying to achieve Geoserver (2.1) authentication through an app being developed with GeoExt. I've found some hints posted by Andreas, saying to use the HTTP Basic Auth<font class="Apple-style-span" face="Verdana, Geneva, Helvetica, Arial, sans-serif"> way. </font></div>
<div><font class="Apple-style-span" face="Verdana, Geneva, Helvetica, Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="Verdana, Geneva, Helvetica, Arial, sans-serif">So if i use the url http://user:password@localhost:8080/geoserver/wms for my layers, i always get a window asking for the user to enter credentials. If i do that, the layers are being correctly loaded, however i would like to avoid the opening of this window. Here is the situation:</font></div>
<div><font class="Apple-style-span" face="Verdana, Geneva, Helvetica, Arial, sans-serif">When the user loads this app, he needs to login. If login is successful then the user will enter to the map interface. The login request, if successful, is sending back the geoserver username and password. So i would like to use this to achieve login to geoserver without prompting the user again to enter credentials.</font></div>
<div><font class="Apple-style-span" face="Verdana, Geneva, Helvetica, Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="Verdana, Geneva, Helvetica, Arial, sans-serif">Any suggestions?</font></div>
<div><font class="Apple-style-span" face="Verdana, Geneva, Helvetica, Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="Verdana, Geneva, Helvetica, Arial, sans-serif">I've also found </font><a href="http://getsatisfaction.com/opengeo/topics/auth_in_geoserver_with_html_php_js" target="_blank" style="font-size: 13px; font-family: arial, sans-serif; background-color: rgba(255, 255, 255, 0.917969); color: rgb(17, 85, 204); ">http://getsatisfaction.com/opengeo/topics/auth_in_geoserver_with_html_php_js</a> </div>
<div>As of my understanding of this post, if we use j_spring_security_check we should get a JSESSONID which can be used as a cookie on the app. I have also tried the following:</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">
<br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><div>Ext.Ajax.request({</div><div><span style="white-space: pre-wrap; ">        </span>url: '<a href="http://localhost:8080/geoserver/j_spring_security_check?" target="_blank" style="color: rgb(17, 85, 204); ">http://localhost:8080/geoserver/j_spring_security_check?</a>',</div>
<div><span style="white-space: pre-wrap; ">        </span>method: 'POST',</div><div><span style="white-space: pre-wrap; ">        </span>scriptTag: true,</div><div><span style="white-space: pre-wrap; ">        </span>params: {</div><div>
<span style="white-space: pre-wrap; ">                </span>username: geoserverUser,</div><div><span style="white-space: pre-wrap; ">                </span>password: geoserverPass</div><div><span style="white-space: pre-wrap; ">        </span>},</div><div>
success: function(){//do stuff...}</div><div>});</div></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">
Nevertheless, the form is still popping out to introduce the user and password, although i get a sucessfull post request (though the response is <span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: monospace; white-space: pre; font-size: small; "> window.location.replace("web");</span>). </div>
<div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">
Thanks in advance. Kind regards,</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">
Hugo</div>