Setting Up Basic Auth
Use Case
How to setup basic authentication between nodes.
Solution
Master Node (Registration Node)
- At the bottom of your existing {SYM_HOME}/web/WEB-INF/web.xml file, add a security constraint by adding the following lines:
/sync/* nodeRole BASIC default - Create a jetty-web.xml with the following contents int the {SYM_HOME}/web/WEB-INF folder. This will add a login service handler.
default /web/WEB-INF/realm.properties - Create a realm.properties file with the following contents and put into the {SYM_HOME}/web/WEB-INF folder. This file contains the usernames and passwords needed by nodes to authenticate.
Note
The format of the realm.properties is "username: password, role". The role in the realm.properties needs to match the role in the web.xml.
node: secret,nodeRole
node2: secret2,nodeRole
Nodes
- Add the following properties to each node. Find the appropriate engine properties file for each node in the {SYM_HOME}/engines/*.properties.
http.basic.auth.username=node http.basic.auth.password=secret