Question

Force WFS reader to send authentication headers

  • 28 August 2018
  • 5 replies
  • 18 views

I'm attempting to use the WFS reader to retrieve a capabilities document using HTTP Basic authentication. However, I suspect that FME isn't sending the Authentication header unless it's challenged with a 401 response from the server, which is a problem because the server I'm connecting to returns 200 response containing public layers for unauthenticated users and hence no challenge.

Are my suspicions are correct? Is there a way to force FME to send the Authentication header without waiting to be challenged with a 401 response?

Things I've tried:

- Checked "Use Network Authentication", selected "Basic" authentication, and added a username and password. No private layers appear under "Feature Types".

- Manually typed the name of a private layer into "Feature Types". FME says that the layer was not found in the capabilities document.

- Added the username and password to the URL, e.g. https://username:password@server/wfs.


5 replies

Badge +6

Hello @tristanmchardie,

I have a couple of questions and steps for you to try to hopefully help solve this issue.

1) Are you able to share the log file from one of your unsuccessful connects?

 

2) What is the first indication that the server is not using the correct Authentication? Is it that the layer list returned only contains the Public layers?

 

3) When you attempt to connect to the WFS with your Authentication, in the log file you should see the GetCapabilities URL. If you plug this into a browser does it access one of the hidden layers?

 

4) If you try to put the Feature Type name parameter on the Get Capabilities URL(accessing one of the layers that require authentication), does that work? Any additional parameters you attach to the URL FME will pass through to each follow-up URL.

 

5) What is the WFS version?

 

 

An alternative you could try is using the HTTPCaller transformer. You can classify the Header that is sent from the HTTPCaller to include the additional authentication. Otherwise, if you can share the log file that should tell us quite a bit - especially if we are able to access the WFS in question.

 

I'm having exactly the same problem. Could you solve it?

 

Retrieving the data with another client (p.ex. Insomnia) works...

 

 

Badge +2
I'm having exactly the same problem. Could you solve it?

 

Retrieving the data with another client (p.ex. Insomnia) works...

 

 

Hi @lorans9, if the problem you are experiencing is the same as tristanmchardie, could you provide more information about your issue, by answering trentatsafe's questions? These info will hopefully help us figure out what's going on. Thank you!

 

Hi @lorans9, if the problem you are experiencing is the same as tristanmchardie, could you provide more information about your issue, by answering trentatsafe's questions? These info will hopefully help us figure out what's going on. Thank you!

 

wfs-av-ueberkanton-featurereadertrsfm.txt

 

wfs-av-ueberkanton-withwfsreader.txt

 

 

Hi Xiaomeng,

 

I'm using FME Desktop 2017.1.2.1 on Windows.

 

And want to download data from an WFS server where is need to do basic authentication.

 

Using the WFS Reader is working fine, but i need to use the FeatureReader transformer to be more dynamic.

 

Setting the FeatureReader 'reader format to: WFS' and use basic authentication doesn't work.. i can still choose the layers 'constraint: feature type to read' this works, but when i start the workbench, i get the "HTTP/1.1 401 Unauthorized" Error.

 

I joined to log files:

 

First the one that working fine using the WFS Reader

 

Second the one using the FeatureReader (WFS Format)

 

Both log files are the result of the same task.

 

Badge +6

Hello @lorans9,

 

 

The fact you are seeing different behavior between the WFS Reader and the FeatureReader is troubling. Would you mind submitting a support ticket here: https://www.safe.com/support/report-a-problem/

 

 

That way we can take a closer look at the issue you are experiencing.

 

Thank you!

Reply