How to authenticate REST API calls for reactions without using plaintext passwords
Authentication details can be saved, instead of (username/password), as an authentication header in the LUY properties file. This may be used in REST API calls and reactions as well.
Requirements
Postman or a similar tool
Access to the server on which LUY is running
Read and write permissions for the "luy_local.properties"
Step-by-step guide:
Generate password string:
Open Postman
Go to the tab "authentication"
Set the "type" to "basic auth"
Enter the username and password, e.g., "LUY" and "P@assw0rd"
Change to the tab "headers"
Copy the value of the key "authorization"
e.g., Basic c3lzdGVtOnBhc3N3b3Jk
Prepare the "luy_local.properties":
Open the file "luy_local.properties"
Add the line "plugin.luy.authorization="
Insert the copied value after "="
Here is an example of the complete entry "plugin.luy.authorization=Basic c3lzdGVtOnBhc3N3b3Jk"
Restart your Tomcat
Use the authentication header in reactions:
Open the reactions script in LUY
Edit or create the script which needs an authentication via REST
Add the following line "api.http.addAuthenticationHeader("plugin.luy.authorization");"
Now, for the authentication via basic auth on REST the set authentication header is used
Additional option
To use more than one "authentication header" in LUY add additional lines in the "luy_local.propterties".
e.g "plugin.luy.authorizationSalesforce="