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
(required)
Details
Using JAAS with jetty is very simply a matter of declaring a Template:Org.mortbay.jetty.plus.jaas.JAASUserRealm, creating a jaas login module configuration file and specifying it on the jetty run line. Let's look at an example.
- Step 1*
Configure a jetty6 Template:Org.mortbay.jetty.plus.jaas.JAASUserRealm to match the {{<realm-name>}} in your Template:Web.xml file. For example, if the Template:Web.xml contains a realm called Template:"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 Template: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:title=Important!} It is imperative that the contents of the {{<realm-name>}} and the {{<Set name="name">}} of the JAASUserRealm instance are _exactly_ the same {warning}{*}Step 2*
Set up your LoginModule in a configuration file, following the [syntax rules
Additional Resources
(optional) - links, additional references
(optional) - categor(ies) to use for this page. If blank, will use the template name as a default category Example: