Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Jetty/Tutorial/JAAS"
Line 332: | Line 332: | ||
| more = (optional) - links, additional references | | more = (optional) - links, additional references | ||
| category = [[Category:Jetty Tutorial]] | | category = [[Category:Jetty Tutorial]] | ||
+ | }} |
Revision as of 12:51, 31 December 2009
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