Skip to main content
Question

Token (Web Connection) does not refresh and all Workflows fail on FME Server

  • 14 May 2024
  • 6 replies
  • 94 views

I have a Web Connection configured that I use in my HTTPCallers as Authentication. This works fine on FME Desktop and also works for some time after uploading to FME Server. But after an hour or so (the expiry time of the token) all workflows on FME Server fail. So my guess is that the Web Connection does not refresh the TOKEN. Do you have any recommendations?

My Web Service Settings:

  • Acces Token Request:
    • Request URL: configured
    • Request Data: configured
  • Access Token Response:
    • Token Object Key: serviceResponse.access_token
    • Expiry Time Object Key: serviceResponse.expires_in
    • Expiry Time Format: Duration (Seconds)
  • API Call Parameters:
    • Placement: Header
    • Header Format: Authorization: Bearer [token]

This is the error log I get:

  • `_error' has value `HTTP/1.1 401 Unauthorized'
  • `_http_status_code' has value `401'
  • `_response_body' has value `{ "statusCode": 401, "message": "GW-Unauthorized. Access token is missing or invalid." }'

6 replies

Badge +41

Not sure if this is you issue, but when I upload a sharepoint web connection to server, I need to authorize that in server after uploading.

Go to files & connections, web connections, select the connection you need, click Authorize.

Badge +3

Thank you for your answer! I tried this but since my web connection is of category TOKEN, I do not have the option to click authorize. I cannot edit the connection on FME Server unfortuately. The only option I can click is remove...

Badge +3

The HTTPCaller in FME Desktop is updating the access token with every run, and I think this is the reason why locally all runs smoothly. How can I force FME Server to update the access token too if it is expired?

Userlevel 5
Badge +32

An interesting (and annoying) finding. What platform are you running FME Server on? Do you see anything in the log file from FME Server about the token getting refreshed?

One thing  which I noticed at one point when using a self made web connection on FME Desktop was the token getting refreshed with (what seemed like) every single call, I thought this was a bit silly and maybe I configured something wrong, after all, why bother asking for an expiration time in the configuration?

In the end I just ignored it and moved on with my day, but I don't think I ever tester it on FME Server. I'll try and give my web connection a test on FME Server and see if I find something similar. 

 

Badge +3

Thank you for your answers! FME Server is running on a Windows Server.

 

SInce yesterday evening all works fine. 😀

I am not yet 100% sure why it works now but it had probably to do with the “Expiry Time Object Key“. After I reconfigured this parameter and published the Web Connection again to FME Server it worked fine.

 

If you have any similar issues, make sure to check and correctly configure “Expiry Time Object Key“!

Badge +7

Thank you for your answers! FME Server is running on a Windows Server.

SInce yesterday evening all works fine. 😀

I am not yet 100% sure why it works now but it had probably to do with the “Expiry Time Object Key“. After I reconfigured this parameter and published the Web Connection again to FME Server it worked fine.

If you have any similar issues, make sure to check and correctly configure “Expiry Time Object Key“!

 

 

For me this didn’t work. I added the Expiry time but the problem still occured. My Solution was as mentionend in the Known Issues Section for FME 2022 (FMESERVER-19419), to remove the web connection and use an  separate HTTP Caller to get a new token each run.

 

Reply