Skip to content

Commit

Permalink
Issue #3463 Fix jaas documentation realm and login module names.
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Bartel <[email protected]>
  • Loading branch information
janbartel committed Mar 19, 2019
1 parent 5c134ef commit 441280c
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ Let's look at an example.

===== Step 1

Configure a Jetty `org.eclipse.jetty.jaas.JAASLoginService` to match the `<realm-name>` in your `web.xml` file. For example, if the `web.xml` contains a realm called "xyz" like so:
Configure a Jetty `org.eclipse.jetty.jaas.JAASLoginService` to match the `<realm-name>` in your `web.xml` file. For example, if the `web.xml` contains a realm called "Test JAAS Realm" like so:

[source, xml, subs="{sub-order}"]
----
<login-config>
<auth-method>FORM</auth-method>
<realm-name>xyz</realm-name>
<realm-name>Test JAAS Realm</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 you need to create a `JAASLoginService` with the matching name of "xyz":
then you need to create a `JAASLoginService` with the matching realm name of "Test JAAS Realm":

[source, xml, subs="{sub-order}"]
----
Expand All @@ -76,9 +76,10 @@ Then you need to create a `JAASLoginService` with the matching name of "xyz":
</New>
----

The `LoginModuleName` must match the name of your LoginModule as declared in your login module configuration file (see <<jaas-step-2,Step 2>>).
____
[CAUTION]
The name of the realm-name that you declare in `web.xml` must match exactly the name of your `JAASLoginService`.
The name of the realm-name that you declare in `web.xml` must match *exactly* the `Name` field of your `JAASLoginService`.
____

You can declare your `JAASLoginService` in a couple of different ways:
Expand Down Expand Up @@ -135,7 +136,7 @@ xyz {

____
[CAUTION]
It is imperative that the application name on the first line is exactly the same as the `LoginModuleName` of your `JAASLoginService`.
It is imperative that the application name on the first line is *exactly* the same as the `LoginModuleName` of your `JAASLoginService`.
____

You may find it convenient to name this configuration file as `etc/login.conf` because, as we will see below, some of the wiring up for JAAS has been done for you.
Expand Down

0 comments on commit 441280c

Please sign in to comment.