Why can't any authorizations can access my service even though I already have Security constraint in web.xml?

36 Views Asked by At

I have the following security constraints entered in web.xml. Role_TestWs can access my service but no authorization can access my service. I want only Role_TestWs to be able to access my service.

<security-constraint>
    <web-resource-collection>
      <web-resource-name>TestWs</web-resource-name>
      <url-pattern>/*</url-pattern>
      <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
      <role-name>Role_TestWs</role-name>
    </auth-constraint>
  </security-constraint>
  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>default</realm-name>
  </login-config>
  <security-role>
    <role-name>Role_TestWs</role-name>
  </security-role>
</web-app>
0

There are 0 best solutions below