Skip to content

BASIC Authentication in Websphere Application Server

1 ) Secure the application resources using the descriptor (web.xml)

<!DOCTYPE web-app PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN” “http://java.sun.com/dtd/web-app_2_3.dtd”>
<web-app id=”WebApp”>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<security-constraint>
<display-name>Constraint-0</display-name>

<web-resource-collection>
<web-resource-name>Constraint-0</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>

<auth-constraint>
<role-name>pegaadmin</role-name>
</auth-constraint>

<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>

</security-constraint>

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

<security-role>
<role-name>pegaadmin</role-name>
</security-role>

</web-app>

 

2) Deploy the application on Websphere Application Server.

3)  Go to

Enterprise Applications > Test_Basic_war > Security role to user/group mapping


You will see the application role configured in the web.xml. Map the users to this role from WAS Console.

Step 4) Go to

Security> Secure administration, applications, and infrastructure  and Check Enable application security.

Restart your Server.

Step 5) Access your application, you will be prompted for authentication.

 

Let us know if you face any issues.

 

Cheers!

Wonders Team

3 Comments

  1. Alok Nayal

    Has this changed in WebSphere 7.0. I tried the same sequence of steps. It worked in Websphere6.x but not in Websphere 7.0

    Posted on 02-Sep-11 at 1:27 pm | Permalink
  2. Administrator

    I am not sure Alok, I need to check on WAS 7.0 but I believe it should be the same.

    Posted on 17-Sep-11 at 4:31 pm | Permalink
  3. Alok Nayal

    It was my bad.. I did not restart the server

    Posted on 28-Nov-11 at 10:25 am | Permalink

Post a Comment

Your email is never published nor shared.