Authentication
UbiFunctions' URLs are publicly exposed. This means that anyone in possession of the URL path would be able to invoke your code.
To add an authentication layer to your function, you may add a preliminary step before execution in order to check the token inside the request.
Ubidots will automatically pass the content of the X-Auth-Token header as an argument of the function:
Request Header | Key inside Function |
X-Auth-Token | TOKEN |
See a Python example below:
Please note that the function would still execute, even if the token is invalid, which would still count towards your usage. We are working on a new method to optionally authenticate a function the same way you'r authenticate any Ubidots API request.
Last updated