Hello everyone,
I've recently been doing some work using HTTPCallers to connect and authenticate to an API. The basic flow is that the first HTTPCaller hits the login endpoint. The credentials (username & password) are passed as application/x-www-form-urlencoded values.
An XML response is sent which contains a Session ID. This is then passed through to all subsequent HTTPCallers via the header as Cookie - ASessionID=<Our session ID>. This all works very well, but I've been asked if I could move the whole authentication part into a nice secure easy to use Web Connection.
I've done similar before, so thought this would be a fairly easy task, but alas, I've hit a bit of a wall when it comes to the Access Token Response. Unfortunately, the login call to this particular API only returns XML and will not return a lovely JSON response for FME to parse and handle. I was under the impression that FME should be able to look at a JSON or an XML response, but I'm having no luck.
Is there some way to get FME to realise that the response it's looking at is in fact XML? I've tried to change the Access Token Request HTTP Header "Accept" to application/xml among other things. Is there a trick to the way I have to format Token Object Key?
PS. I realised it was failing due to seeing the response as JSON due to the following error within my workspace when trying to run it:
WARN |JSON Error: Unable to read response from update access token request. JSON Response: <?xml version="1.0" encoding="UTF-8"?>....
WARN |Unable to obtain updated authorization for web connection 'Asite', credentials may be invalid
Many thanks for your help in advance!
Kind regards
Ryan