Websphere 7 simple realm (like tomcat-users.xml)

Posted by Heavy Bytes on Stack Overflow See other posts from Stack Overflow or by Heavy Bytes
Published on 2010-04-19T15:33:53Z Indexed on 2010/04/19 17:03 UTC
Read the original article Hit count: 804

I am trying to port a J2EE app from Tomcat to Websphere and I'm not too familiar with Websphere.

The only problem I am having is authorization (I use basic-authentication in my web.xml). In Tomcat I use the tomcat-users.xml file to define my users/passwords and to what roles they belong.

How do I do this "simply" in Websphere? When deploying the EAR to Websphere it also asks me to map my role from web.xml to a user or group.

Do I have to set up some sort of realm? Custom user registry?

Thanks.

UPDATE:

I configured a Standalone custom registry, however I can't get a log-in prompt for username/password. It works just fine in Tomcat, and it doesn't in Websphere.

Code from web.xml

<security-constraint>
<web-resource-collection>
<web-resource-name>basic-auth security</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HELLO_USER</role-name>
</auth-constraint>
<user-data-constraint>NONE</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>HELLO_USER</role-name>
</security-role>

© Stack Overflow or respective owner

Related posts about tomcat

Related posts about websphere