Skip to main content
Skip table of contents

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.


  • Postman or a similar tool 

  • Access to the server on which LUY is running

  • Read and write permissions for the "" 

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 "":

  • Open the file "" 

  • 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="

Example reaction script:
'use strict';
function httpWithAuthentication(){
    // Setting parameters for the http request
    // The variable with an authentication header value has to be saved in one of the property files
    // Performing the request
    var result = api.http.execute();
    // We can get information from the response
    api.printLog("The complete response body: " + result.getBody());

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.