The Java EE 6 Tutorial

Managing Users and Groups on the GlassFish Server

Follow these steps for managing users before you run the tutorial examples.

ProcedureTo Add Users to the GlassFish Server

  1. Start the GlassFish Server, if you haven’t already done so.

    Information on starting the GlassFish Server is available in Starting and Stopping the GlassFish Server.

  2. Start the Administration Console, if you haven’t already done so.

    To start the Administration Console, open a web browser and specify the URL http://localhost:4848/. If you changed the default Admin port during installation, type the correct port number in place of 4848.

  3. In the navigation tree, expand the Configuration node.

  4. Expand the Security node.

  5. Expand the Realms node.

  6. Select the realm to which you are adding users.

    • Select the file realm to add users you want to access applications running in this realm.

      For the example security applications, select the file realm.

      The Edit Realm page opens.

    • Select the admin-realm to add users you want to enable as system administrators of the GlassFish Server.

      The Edit Realm page opens.

    You cannot add users to the certificate realm by using the Administration Console. In the certificate realm, you can add only certificates. For information on adding (importing) certificates to the certificate realm, see Adding Users to the Certificate Realm.

  7. On the Edit Realm page, click the Manage Users button.

    The File Users or Admin Users page opens.

  8. On the File Users or Admin Users page, click New to add a new user to the realm.

    The New File Realm User page opens.

  9. Type values in the User ID, Group List, New Password, and Confirm New Password fields.

    For the Admin Realm, the Group List field is read-only, and the group name is asadmin. Restart the GlassFish Server and Administration Console after you add a user to the Admin Realm.

    For more information on these properties, see Working with Realms, Users, Groups, and Roles.

    For the example security applications, specify a user with any name and password you like, but make sure that the user is assigned to the group TutorialUser. The user name and password are case-sensitive. Keep a record of the user name and password for working with the examples later in this tutorial.

  10. Click OK to add this user to the realm, or click Cancel to quit without saving.

Adding Users to the Certificate Realm

In the certificate realm, user identity is set up in the GlassFish Server security context and populated with user data obtained from cryptographically verified client certificates. For step-by-step instructions for creating this type of certificate, see Working with Digital Certificates.