The Java EE 6 Tutorial

ProcedureTo Set Up Your System for Running the Security Examples

To set up your system for running the security examples, you need to configure a user database that the application can use for authenticating users. Before continuing, follow these steps.

  1. Add an authorized user to the GlassFish Server. For the examples in this chapter and in Chapter 26, Getting Started Securing Enterprise Applications, add a user to the file realm of the GlassFish Server, and assign the user to the group TutorialUser:

    1. From the Administration Console, expand the Configuration node.

    2. Expand the Security node.

    3. Expand the Realms node.

    4. Select the File node.

    5. On the Edit Realm page, click Manage Users.

    6. On the File Users page, click New.

    7. In the User ID field, type a User ID.

    8. In the Group List field, type TutorialUser.

    9. In the New Password and Confirm New Password fields, type a password.

    10. Click OK.

    Be sure to write down the user name and password for the user you create so that you can use it for testing the example applications. Authentication is case sensitive for both the user name and password, so write down the user name and password exactly. This topic is discussed more in Managing Users and Groups on the GlassFish Server.

  2. Set up Default Principal to Role Mapping on the GlassFish Server:

    1. From the Administration Console, expand the Configuration node.

    2. Select the Security node.

    3. Select the Default Principal to Role Mapping Enabled check box.

    4. Click Save.