[MapProxy] Configure external wms that requires basic auth

karsten karsten at terragis.net
Mon Oct 21 15:13:54 PDT 2013


Hi,

Thanks. I have this all working now. I was able to configure it using basic
auth similar to this fashion:
http://user1234:xsre242ffs@geo.myserver.org/proxy.php?layers=images&width=60
0&version=1.1.1&bbox=4268292.15725,5251787.80344,4638833.19507,5730276.96684
&service=WMS&format=image%2Fpng&styles=&srs=EPSG%3A31468&request=GetMap&heig
ht=775

I think a restart of apache was needed to get the settings to work.

Good to know that that is the status coed and time in milsecs.  Yes I looked
at the log files and that was what came to mind when I could initially not
get the request working 
Now I know about the status code and time. 

Karsten

----------------------------------

On 17.10.2013, at 21:43, Rahkonen Jukka wrote:
> The 200 - 3177 feels odd. Is it possible that the line is taken from a
server log file and 200 could mean the http code for the result (200 OK) and
3177 the size of the response?

Yes, 200 is the status code, the dash is the content-length (which was not
set by the server in this case) and 3177 is the time it took in
milliseconds.

> I am sure that I have used MapProxy with https and basic authentication
simply by giving the WMS server URL as https://user:passwd@server.com...
> I do not understand why it does not work for you. Are you also behind a
proxy server?

It's strange. A missing http_proxy normally results in blocked connections
or timeouts due to firewall restrictions. An empty image as a response looks
more like the source WMS "blocks" the requests (by server IP, user-agent,
typo in password, etc.). A well behaved server should respond with 401 or
403 in this case, but thats theory...

@Karsten: Can you curl the image from your MapProxy server?

curl --user yourusername
"http://user1234:xsre242ffs@geo.myserver.org/proxy.php?layers=images&width=6
00&version=1.1.1&bbox=4268292.15725,5251787.80344,4638833.19507,5730276.9668
4&service=WMS&format=image%2Fpng&styles=&srs=EPSG%3A31468&request=GetMap&hei
ght=775" -o /tmp/out.png -D - -s


Regards,
Oliver



More information about the MapProxy mailing list