I am using websphere 7 file based basic security for my simple webapplication. My application contains two screen 1.Add Partner 2.List Partner. For this i have created two roles 1.AddPartner 2.ListPartner. I mapped this two roles with different username and password.When user click AddPartner link it should ask for credentials, like same for ListPartner link also. Below is my web.xml entry(i am using strut2 convention)
<security-constraint>
<web-resource-collection>
<web-resource-name>servicepartner</web-resource-name>
<url-pattern>/add-partner</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>AddPartner</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>servicepartner</web-resource-name>
<url-pattern>/list-partner</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>ListPartner</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>AddPartner</role-name>
</security-role>
<security-role>
<role-name>ListPartner</role-name>
</security-role>
but its works for AddPartner but when i click ListPartner link application throwing 403 forbidden error because it checking aganist AddPartner credentials. I am getting below error in my server console.
Authorization failed for user commonuser:defaultWIMFileBasedRealm while invoking GET on default_host:/serviceapp/list-partner, Authorization failed, Not granted any of the required roles: ListPartner
Is it possible to check for different credentials in single application.please help me.