* Issue #11761 fix jetty maven doco and integration test
This commit is contained in:
parent
dd611b4e79
commit
6f2f599b17
|
@ -954,7 +954,9 @@ Here's an example of setting up the `HashLoginService` for a webapp:
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
<name>Test Realm</name>
|
<name>Test Realm</name>
|
||||||
<config>${project.basedir}/src/etc/realm.properties</config>
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
|
<resourceAsString>${basedir}/src/etc/realm.properties</resourceAsString>
|
||||||
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -105,7 +105,9 @@
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
<name>Test Realm</name>
|
<name>Test Realm</name>
|
||||||
<config>src/test/resources/test-realm.properties</config>
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
|
<resourceAsString>src/test/resources/test-realm.properties</resourceAsString>
|
||||||
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -85,7 +85,9 @@
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
<name>Test Realm</name>
|
<name>Test Realm</name>
|
||||||
<config>src/etc/realm.properties</config>
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
|
<resourceAsString>src/etc/realm.properties</resourceAsString>
|
||||||
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -112,8 +112,9 @@
|
||||||
</jettyXmls>
|
</jettyXmls>
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
|
<name>Test Realm</name>
|
||||||
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
<resourceAsString>${basedir}/src/config/login.xml</resourceAsString>
|
<resourceAsString>${basedir}/src/config/realm.properties</resourceAsString>
|
||||||
</config>
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
|
|
|
@ -4,4 +4,24 @@
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||||
version="3.1">
|
version="3.1">
|
||||||
<display-name>Jetty Simple Webapp run-mojo-it</display-name>
|
<display-name>Jetty Simple Webapp run-mojo-it</display-name>
|
||||||
|
|
||||||
|
<security-constraint>
|
||||||
|
<web-resource-collection>
|
||||||
|
<web-resource-name>Any Authenticated User</web-resource-name>
|
||||||
|
<url-pattern>/auth/*</url-pattern>
|
||||||
|
</web-resource-collection>
|
||||||
|
<auth-constraint>
|
||||||
|
<role-name>*</role-name>
|
||||||
|
</auth-constraint>
|
||||||
|
</security-constraint>
|
||||||
|
|
||||||
|
<login-config>
|
||||||
|
<auth-method>FORM</auth-method>
|
||||||
|
<realm-name>Test Realm</realm-name>
|
||||||
|
<form-login-config>
|
||||||
|
<form-login-page>/logon.html?param=test</form-login-page>
|
||||||
|
<form-error-page>/logonError.html?param=test</form-error-page>
|
||||||
|
</form-login-config>
|
||||||
|
</login-config>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<html>
|
||||||
|
<h1>Authenticated</h1>
|
||||||
|
</html>
|
|
@ -0,0 +1,20 @@
|
||||||
|
<html>
|
||||||
|
<h1>FORM Authentication demo</h1>
|
||||||
|
<form method="POST" action="j_security_check">
|
||||||
|
<table border="0" cellspacing="2" cellpadding="1">
|
||||||
|
<tr>
|
||||||
|
<td>Username:</td>
|
||||||
|
<td><input size="12" value="" name="j_username" maxlength="25" type="text"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Password:</td>
|
||||||
|
<td><input size="12" value="" name="j_password" maxlength="25" type="password"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" align="center">
|
||||||
|
<input name="submit" type="submit" value="Login">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</html>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<html>
|
||||||
|
<h1>Authentication ERROR</h1>
|
||||||
|
Username, password or role incorrect.
|
||||||
|
</html>
|
|
@ -101,7 +101,9 @@
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
<name>Test Realm</name>
|
<name>Test Realm</name>
|
||||||
<config>${project.build.testOutputDirectory}/test-realm.properties</config>
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
|
<resourceAsString>${project.build.testOutputDirectory}/test-realm.properties</resourceAsString>
|
||||||
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -61,7 +61,9 @@
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
<name>Test Realm</name>
|
<name>Test Realm</name>
|
||||||
<config>${project.build.directory}/realm.properties</config>
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
|
<resourceAsString>${project.build.directory}/realm.properties</resourceAsString>
|
||||||
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -140,8 +140,9 @@
|
||||||
</jettyXmls>
|
</jettyXmls>
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
|
<name>Test Realm</name>
|
||||||
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
<resourceAsString>${basedir}/src/config/login.xml</resourceAsString>
|
<resourceAsString>${basedir}/src/config/realm.properties</resourceAsString>
|
||||||
</config>
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
|
|
|
@ -4,4 +4,24 @@
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||||
version="3.1">
|
version="3.1">
|
||||||
<display-name>Jetty Simple Webapp run-mojo-it</display-name>
|
<display-name>Jetty Simple Webapp run-mojo-it</display-name>
|
||||||
|
|
||||||
|
<security-constraint>
|
||||||
|
<web-resource-collection>
|
||||||
|
<web-resource-name>Any Authenticated User</web-resource-name>
|
||||||
|
<url-pattern>/auth/*</url-pattern>
|
||||||
|
</web-resource-collection>
|
||||||
|
<auth-constraint>
|
||||||
|
<role-name>*</role-name>
|
||||||
|
</auth-constraint>
|
||||||
|
</security-constraint>
|
||||||
|
|
||||||
|
<login-config>
|
||||||
|
<auth-method>FORM</auth-method>
|
||||||
|
<realm-name>Test Realm</realm-name>
|
||||||
|
<form-login-config>
|
||||||
|
<form-login-page>/logon.html?param=test</form-login-page>
|
||||||
|
<form-error-page>/logonError.html?param=test</form-error-page>
|
||||||
|
</form-login-config>
|
||||||
|
</login-config>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<html>
|
||||||
|
<h1>Authenticated</h1>
|
||||||
|
</html>
|
|
@ -0,0 +1,20 @@
|
||||||
|
<html>
|
||||||
|
<h1>FORM Authentication demo</h1>
|
||||||
|
<form method="POST" action="j_security_check">
|
||||||
|
<table border="0" cellspacing="2" cellpadding="1">
|
||||||
|
<tr>
|
||||||
|
<td>Username:</td>
|
||||||
|
<td><input size="12" value="" name="j_username" maxlength="25" type="text"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Password:</td>
|
||||||
|
<td><input size="12" value="" name="j_password" maxlength="25" type="password"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" align="center">
|
||||||
|
<input name="submit" type="submit" value="Login">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</html>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<html>
|
||||||
|
<h1>Authentication ERROR</h1>
|
||||||
|
Username, password or role incorrect.
|
||||||
|
</html>
|
|
@ -111,7 +111,9 @@
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
<name>Test Realm</name>
|
<name>Test Realm</name>
|
||||||
<config>src/test/resources/test-realm.properties</config>
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
|
<resourceAsString>src/test/resources/test-realm.properties</resourceAsString>
|
||||||
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -61,7 +61,9 @@
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
<name>Test Realm</name>
|
<name>Test Realm</name>
|
||||||
<config>src/etc/realm.properties</config>
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
|
<resourceAsString>src/etc/realm.properties</resourceAsString>
|
||||||
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -112,8 +112,9 @@
|
||||||
</jettyXmls>
|
</jettyXmls>
|
||||||
<loginServices>
|
<loginServices>
|
||||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||||
|
<name>Test Realm</name>
|
||||||
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
<config implementation="org.eclipse.jetty.maven.MavenResource">
|
||||||
<resourceAsString>${basedir}/src/config/login.xml</resourceAsString>
|
<resourceAsString>${basedir}/src/config/realm.properties</resourceAsString>
|
||||||
</config>
|
</config>
|
||||||
</loginService>
|
</loginService>
|
||||||
</loginServices>
|
</loginServices>
|
||||||
|
|
|
@ -4,4 +4,24 @@
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||||
version="3.1">
|
version="3.1">
|
||||||
<display-name>Jetty Simple Webapp run-mojo-it</display-name>
|
<display-name>Jetty Simple Webapp run-mojo-it</display-name>
|
||||||
|
|
||||||
|
<security-constraint>
|
||||||
|
<web-resource-collection>
|
||||||
|
<web-resource-name>Any Authenticated User</web-resource-name>
|
||||||
|
<url-pattern>/auth/*</url-pattern>
|
||||||
|
</web-resource-collection>
|
||||||
|
<auth-constraint>
|
||||||
|
<role-name>*</role-name>
|
||||||
|
</auth-constraint>
|
||||||
|
</security-constraint>
|
||||||
|
|
||||||
|
<login-config>
|
||||||
|
<auth-method>FORM</auth-method>
|
||||||
|
<realm-name>Test Realm</realm-name>
|
||||||
|
<form-login-config>
|
||||||
|
<form-login-page>/logon.html?param=test</form-login-page>
|
||||||
|
<form-error-page>/logonError.html?param=test</form-error-page>
|
||||||
|
</form-login-config>
|
||||||
|
</login-config>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<html>
|
||||||
|
<h1>Authenticated</h1>
|
||||||
|
</html>
|
|
@ -0,0 +1,20 @@
|
||||||
|
<html>
|
||||||
|
<h1>FORM Authentication demo</h1>
|
||||||
|
<form method="POST" action="j_security_check">
|
||||||
|
<table border="0" cellspacing="2" cellpadding="1">
|
||||||
|
<tr>
|
||||||
|
<td>Username:</td>
|
||||||
|
<td><input size="12" value="" name="j_username" maxlength="25" type="text"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Password:</td>
|
||||||
|
<td><input size="12" value="" name="j_password" maxlength="25" type="password"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" align="center">
|
||||||
|
<input name="submit" type="submit" value="Login">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</html>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<html>
|
||||||
|
<h1>Authentication ERROR</h1>
|
||||||
|
Username, password or role incorrect.
|
||||||
|
</html>
|
Loading…
Reference in New Issue