M
M
mindgrow2021-02-26 11:22:34
Maven
mindgrow, 2021-02-26 11:22:34

How to setup authorization in maven-jetty-plugin?

I raise a web application in the idea
I use maven-jetty-plugin

Initially, the error looked like this:

java.lang.IllegalStateException: No LoginService for [email protected]e944 in

began to configure according to the article
https://stackoverflow.com/questions/49930501/illeg...

web.xml
<login-config>
        <auth-method>FORM</auth-method>
        <realm-name>myrealm</realm-name>
        <form-login-config>


jetty-webapp.xml example
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!--    <Call name="addBean">-->
<!--        <Arg>-->
<!--            <New class="org.eclipse.jetty.plus.jaas.JAASLoginService">-->
<!--                <Set name="Name">myrealm</Set>-->
<!--                <Set name="LoginModuleName">myrealm</Set>-->
<!--            </New>-->
<!--        </Arg>-->
<!--    </Call>-->
    <Set name="securityHandler">
        <New class="org.eclipse.jetty.security.ConstraintSecurityHandler">
            <Set name="loginService">
                <New class="org.eclipse.jetty.plus.jaas.JAASLoginService">
                    <Set name="Name">myrealm</Set>
                    <Set name="LoginModuleName">myrealm</Set>
                </New>
            </Set>
        </New>
    </Set>
</Configure>

https://git.eclipse.org/c/jetty/org.eclipse.jetty....

Swears
[WARNING] Config error at <Set name="loginService">
Config error at <Set name="loginService">

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question