How To Add Basic Auth To Flogo Apps in TIBCO Cloud Integration
Unlock the power of Basic Authentication in TIBCO Cloud Integration's Web Integrator! Learn how to seamlessly integrate it using simple steps. Your gateway to efficient API handling awaits!
Over the past few weeks I’ve gotten many questions on how to use Basic Authentication with the new Web Integrator in TIBCO Cloud Integration. It is really easy to do that!
When you’re using an InvokeRESTService activity in Web Integrator the tab Input Settings has section called Request Headers and in that table you can specify the HTTP headers you want to use. To add a header parameter, click the +
button and press Enter to save your changes. For HTTP Basic Authentication you need to specify the header Authorization
.
HTTP Basic Authentication simply passes on the word Basic:
(and a space) with a Base64 encoded string of the username and password. For example, Basic: dXNlcjpwYXNz
would be the value for the header if the username/password
was user:pass
. In Web Integrator you can create this expression very easily using the mapper. The expression you can use on the Input tab for the above scenario would be string.concat("Basic: ", string.stringToBase64("user:pass"))
If you want to test it out and see what the exact headers are your request is sending, I can recommend RequestBin. RequestBin is a community project from Runscope and you can use RequestBin to see what your HTTP client is sending or to inspect and debug webhook requests. Alternatively you can host RequestBin yourself following the steps on GitHub.