Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Jetty/Tutorial/JAAS
Introduction
Using JAAS with jetty is very simply a matter of declaring a org.mortbay.jetty.plus.jaas.JAASUserRealm, creating a jaas login module configuration file and specifying it on the jetty run line.
Details
Let's look at an example.
Step 1
Configure a Jetty org.mortbay.jetty.plus.jaas.JAASUserRealm to match the <realm-name> in your web.xml file. For example, if the web.xml contains a realm called "xyzrealm":
<login-config> <auth-method>FORM</auth-method> <realm-name>xyzrealm</realm-name> <form-login-config> <form-login-page>/login/login</form-login-page> <form-error-page>/login/error</form-error-page> </form-login-config> </login-config>
Then the following JAASUserRealm would be declared in a Jetty configuration file:
<Call name="addUserRealm"> <Arg> <New class="org.mortbay.jetty.plus.jaas.JAASUserRealm"> <Set name="name">xyzrealm</Set> <Set name="LoginModuleName">xyz</Set> </New> </Arg> </Call>
warning
Additional Resources
(optional) - links, additional references