Java Reference
In-Depth Information
3. Associate each role with a user group in the glassfish-web.xml file. In
the realm, each user is associated with a user group. However, the URL pat-
terns are associated with roles. So, you need to tell the server which group
a role belongs to. In GlassFish, this is possible through the <security-
role-mapping> element. The following code shows the complete contents
of the glassfish-web.xml file with the role-group combination:
<glassfish-web-app error-url=""
<class-loader delegate="true"/>
4. Declare the realm and authentication types to be used by our application
in web.xml . The following code demonstrates how to declare the
MyJDBCRealm we created in the preceding step. The authentication type we
have chosen is DIGEST . It transmits the password in an encrypted form.
Once you complete these configurations, candidates can access the registration
forms without any problem. But, if they try to connect to an admin form, a window
similar to the following window will be displayed:
Search WWH ::

Custom Search