Specifying Authentication in the JSP

Use

The first step is to specify authentication in the JSP. Afterwards, only users who are successfully authenticated on the J2EE Engine can access the quick car rental application.

There are four types of authentication available: BASIC, DIGEST, FORM, and CLIENT-CERT. For more information about these types, see Authentication on J2EE Engine.

For this tutorial, you will specify BASIC (Basic Authentication).

Prerequisites

The J2EE Development perspective is displayed in the SAP NetWeaver Developer Studio.

The quick car rental application’s Web client project, J2EE_QuickCarRentalWeb, is displayed in the J2EE Explorer.

Procedure

...

       1.      Expand the J2EE_QuickCarRentalWeb project.

       2.      Open the web.xml file by selecting it with a double-click.

The Developer Studio’s multi-page editor appears.

       3.      On the General tab:

                            a.      Select the Login configuration indicator.

                            b.      Select BASIC for the Authorization method.

See the preview below for an example of the input.

       4.      Save the data.

Result

The <login-config> element is added to the deployment descriptors for the Web application in the web.xml file as shown below:

   <login-config>
      <auth-method>BASIC</auth-method>
   </login-config>

Next Step:

Specifying the Policy Domain to Use for Authentication