Most Popular
Recently Added
Recently Updated

Setting Up Basic Auth

Use Case

How to setup basic authentication between nodes.


Master Node (Registration Node)

  1. At the bottom of your existing {SYM_HOME}/web/WEB-INF/web.xml file, add a security constraint by adding the following lines:
    <security-constraint> <web-resource-collection> <url-pattern>/sync/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>nodeRole</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>BASIC</auth-method> <realm-name>default</realm-name> </login-config>
  2. Create a jetty-web.xml with the following contents int the {SYM_HOME}/web/WEB-INF folder. This will add a login service handler.
    <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Get name="securityHandler"> <Set name="loginService"> <New class=""> <Set name="name">default</Set> <Set name="config"> <SystemProperty name="user.dir" default="."/>/web/WEB-INF/ </Set> </New> </Set> </Get> </Configure> <p>

  3. Create a 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.


    The format of the is "username: password, role". The role in the needs to match the role in the web.xml.

    node: secret,nodeRole
    node2: secret2,nodeRole


  4. Add the following properties to each node. Find the appropriate engine properties file for each node in the {SYM_HOME}/engines/*.properties.

Properties ID: 000029   Views: 1826   Updated: 5 years ago
Filed under: