@Mindgrow

Как настроить авторизацию в maven-jetty-plugin?

Поднимаю веб приложение в идее
Использую maven-jetty-plugin

Изначально ошибка выглядела так:
java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.FormAuthenticator@5d66e944 in

стал настраивать по статье
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
<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....

Ругается
[WARNING] Config error at <Set name="loginService">
Config error at <Set name="loginService">
  • Вопрос задан
  • 60 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы