401 Unauthorized Error When Making FME Flow Request

Liz Sanderson
Liz Sanderson
  • Updated

Symptom

When making an HTTP request to one of FME Flow's (formerly FME Server) services (Job Submitter, Data Download, REST API), you receive a response with error code 401 Unauthorized. This is visible either directly in the browser or upon inspection of an AJAX call in the F12 Developer Tools.

To learn how to use Developer Tools to monitor network traffic, please see the following documentation:

Edge
Chrome
Firefox

Cause

FME Flow responds with the 401 Unauthorized error when no authorization has been sent for a resource that requires it. This does not mean that the user is not permitted to access the resource, but that no user credentials have been supplied with the request.

Resolution

Authorization can be sent in a few different ways.

1. The recommended method for the REST API is to include the following header:

 Authorization: fmetoken token=your-fme-server-token


2. All the services, including the REST API, accept a token in the query string. For example,

 http://<host>:<port>/fmejobsubmitter/Samples/austinApartments.fmw?token=your-fme-server-token

Note that you will need Token Security permission to use this method of authorization.

3. Finally, basic authentication can also be used. This will typically be given through a dialog prompt with fields for username and password, but can also be given programmatically with one of the following methods:

a. Set the authorization header to

 Authorization: Basic <base64 encoded string "username:password">


b. Include the username and password in the URL

 http://username:password@<host>:<port>/fmejobsubmitter/Samples/austinApartments.fmw

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.