PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Set up BasicRegistry and role mapping on the Liberty profile

+

Search Tips   |   Advanced Search

Set up BasicRegistry and role mapping on the Liberty profile

You can configure the Liberty profile to authenticate and authorize users by a basic user registry.

  1. Enable features appSecurity-2.0 and servlet-3 server.xml of the Liberty profile.

  2. Set user name and password.

      <basicRegistry id="basic" realm="WebRealm">
         <user name="Bob" password="bobpwd" />
      </basicRegistry>

  3. Grant roles to users and groups...

    This step is done automatically when using the quickStartSecurity element.

  4. Use securityUtility to Encode the password within the configuration.

  5. Add additional users....

      <basicRegistry id="basic" realm="WebRealm">
         <user name="Bob" password="bobpwd" />
         <user name="user1" password="user1pwd" />
         <user name="user2" password="user2pwd" />
      </basicRegistry>
      

  6. Create groups for users...

      <basicRegistry id="basic" realm="WebRealm">
      
         <user name="Bob" password="bobpwd" />
         <user name="user1" password="user1pwd" />
         <user name="user2" password="user2pwd" />
      
         <group name="myAdmins">
             <member name="Bob" />
             <member name="user1" />
         </group>
        
         <group name="users">
             <member name="user1" />
             <member name="user2" />
         </group>
      
      </basicRegistry>
      

  7. Assign some users and groups to the testing role of an application.
    <application type="war" 
                 id="myWebApp" 
                 name="myWebApp"
                 location="${server.config.dir}/apps/myWebApp.war">
    
         <application-bnd>
             <security-role name="testing">
                   <user name="Bob" />
                   <user name="user1" />
                   <group name="users" />
             </security-role>
         </application-bnd>
    
    </application>


What to do next

Configure security-related elements in the deployment descriptor of the application.


Parent topic:
Get started with security

Concepts: The limits to protection through password encryption