Bug report #9026

WFS connection trouble with partly secured server

Added by Jukka Rahkonen about 11 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Web Services clients/WFS
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:17681

Description

This server has some open-for-all WFS layers and some which need authentication
http://tampere.navici.com/tampere_wfs_geoserver/tampere_ora/ows?
For example this is free: TYPENAME=tampere_ora:KH_TILASTO
but this is secured: TYPENAME=tampere_ora:ONK_NMR_MVIEW

QGIS has no troubles as long as I am reading just the free layers. Discussion between client and server goes without authentication and both are happy. Trouble begins is I try to read a secured layer. The server sends back "HTTP/1.1 401 Unauthorized" and asks to give credentials. I do not have those and therefore I just ask QGIS to cancel this operation.

The trouble is that after cancelling the trial to read the secured layer QGIS cannot any more get data from the free feature types. This seems to come from that after the cancelled operation QGIS is adding the Authorization header "Authorization: Basic Og==" to the requests and the server is rejecting all of them. Below is an example about how the discussion goes:

GET http://tampere.navici.com/tampere_wfs_geoserver/tampere_ora/ows?SERVICE=WFS&REQUEST=GetCapabilities&VERSION=1.0.0 HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip
Accept-Language: fi-FI,en,*
User-Agent: Mozilla/5.0
Host: tampere.navici.com
Authorization: Basic Og==

HTTP/1.1 401 Unauthorized
Date: Thu, 07 Nov 2013 05:19:52 GMT
Set-Cookie: SPRING_SECURITY_REMEMBER_ME_COOKIE=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/tampere_wfs_geoserver
WWW-Authenticate: Basic realm="GeoServer Realm"
Content-Type: text/html;charset=utf-8
Vary: Accept-Encoding
Content-Length: 1299
Keep-Alive: timeout=15, max=96
Connection: Keep-Alive

In an attachment there are all the requests and answers from such a case, I only removed the long XML data contents from GetCapabilities and successfull GetFeature.

QGIS_talking_with_partly_secured_WFS_server.txt Magnifier (23.7 KB) Jukka Rahkonen, 2013-11-07 12:39 AM

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Open to Feedback

Please test with a recent QGIS release (2.18 or 3), if the issue/request is still valid change the affected version accordingly, if is fixed/implemented then close the ticket. Thanks!

#3 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed
  • Description updated (diff)

Closing for lack of feedback.

Also available in: Atom PDF