Demo Home
Demo Web Application Only - Do NOT Deploy in Production

JAAS Authentication and Authorization Demo

Preparation

To enable JAAS in a base jetty instance do:

    $ cd $JETTY_BASE
    $ java -jar $JETTY_HOME/start.jar --add-module=jaas
    

This will create a $JETTY_BASE/start.d/jaas.ini file to enable and parameterize JAAS. This Jetty demo-jaas already has JAAS enabled by the demo-jaas module.

The full source of this demonstration is available here.

Using the Demo

Click on the link below to test JAAS authentication and role-based web security constraint authorization. Use username="me" with password="me". All other usernames, passwords should result in authentication failure.

LOGIN

This demo uses a simple login module that stores its configuration in a properties file. There are other types of login module provided with the jetty distro. For full information, please refer to the Jetty 9 documentation.