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.
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:
From the Administration Console, expand the Configuration node.
Expand the Security node.
Expand the Realms node.
Select the File node.
On the Edit Realm page, click Manage Users.
On the File Users page, click New.
In the User ID field, type a User ID.
In the Group List field, type TutorialUser.
In the New Password and Confirm New Password fields, type a password.
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.
Set up Default Principal to Role Mapping on the GlassFish Server: