Hi Paolo
Which GeoServer version are you talking about ?
Two possibilities
1) If you authenticate using
'http://myserver/geoserver/j_spring_security_check'
you have to send two http parameters in the POST body
username: myusername
password: mypassword
You will receive a cookie which you have to attach to all future requests.
No basic auth needed.
2) Call the services directly and add the "Authorization" header for EACH
request. Geoserver does not create a session.
Hope that helps
2013/2/20 Paolo Corti <[email protected]>
> Hi list
> I am pretty new to the GeoServer security system, so please bear my
> request if it is obvious :)
>
> I have a web application that needs to provide a map viewer using
> secured WMS layers from GeoServer (installed together with GeoNode).
> After reading some posts [1] [2] [3] in the list, I am trying with
> this approach (in Python ) to generate a valid JSESSIONID using Basic
> Authentication to be used for any request from the client to access
> the secured layers:
>
> from httplib2 import Http
> url = 'http://myserver/geoserver/j_spring_security_check'
> hds = {
> "Authorization": "Basic secretbase64xyz=",
> }
> h = Http()
> gs_resp, gs_content = h.request(url, "POST", headers=hds )
>
> If I investigate the gs_resp variable, I effectively find a valid
> JSESSIONID, but the status of the GeoServer response is 302, and in my
> client map viewer the layers are still not displayed:
>
> ipdb> gs_resp
> {'status': '302', 'content-length': '0', 'set-cookie':
> 'JSESSIONID=95223F466298BA31F6DF96F90D98C1C9; Path=/geoserver',
> 'server': 'Apache-Coyote/1.1', 'location':
> '
> http://myserver/geoserver/web/;jsessionid=95223F466298BA31F6DF96F90D98C1C9?wicket:bookmarkablePage=:org.geoserver.web.GeoServerLoginPage&error=true
> ',
> 'date': 'Tue, 19 Feb 2013 00:16:58 GMT', 'content-type': 'text/plain'}
>
> Any suggestions?
> Thanks in advance
> p
>
> [1]
> http://osgeo-org.1560.n6.nabble.com/Authenticate-in-Geoserver-from-PHP-application-td5009457.html
> [2]
> http://osgeo-org.1560.n6.nabble.com/Geoserver-Authentication-td3788480.html
> [3] http://en.usenet.digipedia.org/thread/12186/13463/
>
> --
> Paolo Corti
> Geospatial software developer
> web: http://www.paolocorti.net
> twitter: @capooti
> skype: capooti
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users