<security-constraint> programmatically Tomcat

102 Views Asked by At

I ask help for a question similar to "UPDATE" section in this question How to programmatically setup a <security-constraint> in Servlets 3.x? ...

I want to set programmatically, in a java class, some web.xml tags. In particular i have to define this snippt in a separate java class:

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Application detail</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
    </security-constraint>
    <security-role>
        <role-name>*</role-name>
    </security-role>
    <login-config>
        <auth-method>OIDC</auth-method>
    </login-config>

Thank you!


0

There are 0 best solutions below