Websphere 7 simple areas (e.g. tomcat-users.xml)

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

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

How do I make this “simple” in Websphere? When deploying an EAR to Websphere, he also asks me to map my role to web.xml with a user or group.

Do I need to create some kind of sphere? User user registry?

Thank.

UPDATE:

I have set up a standalone custom registry, but I cannot get a login prompt for username / password. It works great on Tomcat, and it doesn't work on 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>
+3
source share
3 answers

Application security in WAS is not enabled by default.

In the administrator’s console, go to SecurityGlobal Security and make sure the Enable application protection check box is selected .

You may need to restart the server after saving the changes.

+5
source
+4
0

Source: https://habr.com/ru/post/1741798/


All Articles