After writing all this below I remember I have blogged about this for myself here:
WebSphere 6.1 and Application Authentication
As I understand you have setup your web.xml correctly thus:
<security-role>
<role-name>myrole</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>mySec</web-resource-name>
<url-pattern>/yourUrl</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>TRACE</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>myrole</role-name>
</auth-constraint>
<user-data-constraint>
<description>SSL or MSSL not required</description>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>my login</realm-name>
</login-config>
This is if you are using the administration console you dont state that you are not so go to the console:
http://localhost:9060/ibm/console
Then login (if you have administrative security setup)
Then go here
- left hand panel click Security
- Secure administration, applications, and infrastructure
- There is then a section on the page Application security
- Check the box Enable application security
- click apply, then save to master config.
Then you have application security turned on. Now you need to map the users of your application to users within websphere.
Go here
- List item
- Applications > Enterprise Applications
- Click your application
- Under the Detailed Properties section you will see a link Security role to user/group mapping
you will only see this link if your web.xml is setup correctly
- click the Security role to user/group mapping
- Select the roles you wish to use for authentication
- Click look up users or look up groups
- click search and select users (that are setup in your websphere under Users and Groups menu
- use the arrows to move the selected users/groups to the right hand box
- click ok and save to master configuration.
- restart your server.
Administration security (security of Websphere itself) must be turned on for it to work.
WebSphere can be complex but it is powerful and capable.