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

5 comments

  1. 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

  2. HI I am facing the same problem .I have done everything that you have mentioned I got the was level authentication but still strugling to get application level authentication .I am using was 7 .kindly help me ..

    1. the issue might be with the deployment descriptor settings.. can you please paste ur web.xml here

Comments are closed.