[OpenLayers-Users] Setting default header parameter for all ajax requests

Roald de Wit roald.dewit at lisasoft.com
Tue Apr 28 20:20:07 EDT 2009


Hi Milan,

Even if you could pass the password into the request, this password
could easily be found by anyone by looking at the request or source code.
If you want this to work and keep the password secret, I think you'd
need to pass all your WMS requests  (that need authentication) through a
proxy that adds the authentication header before forwarding the request
to the real WMS server. You might even want to use MapServer to do this
for you!

And yes, wouldn't it be nice if there was an open source identity
management solution out there that can do that? I don't know of any at
the moment.

Regards, Roald

Christopher Schmidt wrote:
> On Tue, Apr 28, 2009 at 06:45:17PM +0200, Milan Antonovic wrote:
>
>> Hi all,
>> I have a question for you..
>> I would like to set the default header parameter for all the openlayers ajax
>> request, even that used by OpenLayers.Layer.Wms.
>>
>
> WMS requests don't go through AJAX, so this is not possible in the
> current OpenLayers code. (They are requested via <img>, which does not
> have support for adding headers.)
>
> -- Chris
>
>
>
>> That's because I need to set the "Authorization" parameter in the header
>> with user and password for my WMS Layers.
>>
>> I've tried with:
>>
>> OpenLayers.Util.extend(
>>   OpenLayers.Request.DEFAULT_CONFIG,
>>   {
>>     headers: {Authorization: "BASIC " + usrPsw}
>>   }
>> );
>>
>> But when I look at the request header sent it does not appear..
>>
>> Help [?]
>>
>> my rgds
>>
>> Milan
>>
>
>
>
>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>
>
>


--
Roald de Wit
Software Engineer
roald.dewit at lisasoft.com

Commercial Support for Open Source GIS Software
http://lisasoft.com/LISAsoft/SupportedProducts/



The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.



More information about the Users mailing list