Did you try
http://osgeo-org.1560.x6.nabble.com/Load-GeoServer-WMS-secured-layers-with-OpenLayers-td3919938.html
The answer from Andreas should help.
Christian
On Wed, Aug 28, 2013 at 2:34 AM, Jerome A. Wendell <[email protected]
> wrote:
> I am using GeoServer Version 2.2.4, and have been using it without any
> security on the data layers accessed using OpenLayers. I am now trying to
> add layer security to some of my layers. I have been researching this and
> it appears that I need to add authentication to the header of each request
> (or at least that is one option). I create the authorization string as
> follows:****
>
> ** **
>
> var userpass = username + ":" + password;****
>
> ** **
>
> I calculate the base64 encoding of the string as below:****
>
> ** **
>
> var auth = make_basic_auth(userpass); //The
> make_basic_auth() function utilizes the Base64.js from
> Webtoolkit<http://www.webtoolkit.info/javascript-base64.html>
> .****
>
> ** **
>
> Then I add the following to the options in the HTTP request:****
>
> ** **
>
> headers: {Authorization: auth}****
>
> ** **
>
> In viewing the header of the request in Firebug, the authorization string
> is included in the request header. But, the layer is not being read
> because I get the pink tiles. I am using a ProxyHost.****
>
> ** **
>
> If I am trying to accomplish the basic authorization in the wrong way,
> please let me know. Any suggestions that you may have are greatly
> appreciated.****
>
> ** **
>
> Thanks,****
>
> ** **
>
> Jerome Wendell****
>
> ** **
>
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
DI Christian Mueller MSc (GIS), MSc (IT-Security)
OSS Open Source Solutions GmbH
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users