Dear all,
I have been trying to install Jenkins in a Jetty container. I soon came across the problem that Jenkins requires a login service
My problem is that the solutions described here do not seem to work. Only when I introduced a realm name into the Jenkins configuration that matched the name provided to the LoginService did Jenkins start up ok. However, now when I access it for the first time I am asked to set up security but not for an admin password, so I am logged out of the system as soon as I turn security on. There does not seem to be a way to provide the admin password. I seem to remember that Jenkins was asking for one in earlier versions. So, I suspect that either my providing a realm name in web.xml was wrong (but what name should I give the LoginSevice?) or there is another problem?
I am using Jenkins 1.514 and Jetty 9.0.3.v20130506.
My Jetty application context configuration (webapps/jenkins.xml) looks like this:
--8<--
<?xml version="1.0" encoding="ISO-8859-1"?>
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/jenkins.war</Set>
<Set name="contextPath">/jenkins</Set>
<Set name="overrideDescriptor"><SystemProperty name="jetty.home" default="."/>/confs/jenkins-web.xml</Set>
<Get name="securityHandler">
<Set name="loginService">
<New class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">jenkins</Set>
<Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
</New>
</Set>
</Get>
</Configure>
--8<--
and my overlay web.xml (confs/jenkins-web.xml) like this:
--8<--
<?xml version="1.0" encoding="UTF-8"?>
version="2.4">
<login-config>
<auth-method>FORM</auth-method>
<realm-name>jenkins</realm-name>
<form-login-config>
<form-login-page>/login</form-login-page>
<form-error-page>/loginError</form-error-page>
</form-login-config>
</login-config>
</web-app>
--8<--
Cheers,
Alex