commit 62b8daac3eef1489d2c3576dd7619de86f0b355a
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Tue May 2 15:11:37 2017 +0200

    auto login feature for developers

diff --git a/ide/eclipse/Jetty Launcher/cdm-vaadin - run.launch b/ide/eclipse/Jetty Launcher/cdm-vaadin - run.launch
index aab47645..bb252acd 100644
--- a/ide/eclipse/Jetty Launcher/cdm-vaadin - run.launch	
+++ b/ide/eclipse/Jetty Launcher/cdm-vaadin - run.launch	
@@ -54,5 +54,5 @@
 <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="net.sourceforge.eclipsejetty.launcher.JettyLaunchClassPathProvider"/>
 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.sourceforge.eclipsejetty.starter.jetty9.Jetty9LauncherMain"/>
 <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="cdm-vaadin"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dlog4j.configDebug=false&#10;-Dlog4j.configuration=file:///${system_property:user.home}/.cdmLibrary/log4j.properties&#10;&#10;-Dcdm.forceSchemaUpdate=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dlog4j.configDebug=false&#10;-Dlog4j.configuration=file:///${system_property:user.home}/.cdmLibrary/log4j.properties&#10;&#10;-Dcdm.forceSchemaUpdate=true&#10;&#10;-Dcdm-vaadin.login.usr=admin&#10;-Dcdm-vaadin.login.pwd=00000"/>
 </launchConfiguration>
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/LoginPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/LoginPresenter.java
index df4329ee..21c773c5 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/LoginPresenter.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/LoginPresenter.java
@@ -8,6 +8,8 @@
 */
 package eu.etaxonomy.cdm.vaadin.view;
 
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.context.event.EventListener;
@@ -30,6 +32,13 @@ import eu.etaxonomy.vaadin.ui.navigation.NavigationManager;
  * The {@link LoginView is used as replacement view in the scope of other views.
  * Therefore the LoginPresenter must be in <b>UIScope</b> so that the LoginPresenter
  * is available to all Views.
+ * <p>
+ * The LoginPresenter offers a <b>auto login feature for developers</b>. Tio activate the auto login
+ * you need to provide the <code>user name</code> and <code>password</code> using the environment variables
+ * <code>cdm-vaadin.login.usr</code> and <code>cdm-vaadin.login.pwd</code>, e.g.:
+ * <pre>
+ * -Dcdm-vaadin.login.usr=admin -Dcdm-vaadin.login.pwd=00000
+ * </pre>
  *
  * @author a.kohlbecker
  * @since Apr 25, 2017
@@ -41,6 +50,12 @@ public class LoginPresenter extends AbstractPresenter<LoginView> {
 
     private static final long serialVersionUID = 4020699735656994791L;
 
+    private static final Logger log = Logger.getLogger(LoginPresenter.class);
+
+    private final static String PROPNAME_USER = "cdm-vaadin.login.usr";
+
+    private final static String PROPNAME_PASSWORD = "cdm-vaadin.login.pwd";
+
     @Autowired
     protected ApplicationEventPublisher eventBus;
 
@@ -60,8 +75,10 @@ public class LoginPresenter extends AbstractPresenter<LoginView> {
         Authentication authentication = authenticationManager.authenticate(token);
 
         if(authentication != null && authentication.isAuthenticated()) {
+            log.debug("user '" + userName + "' autheticated");
             currentSecurityContext().setAuthentication(authentication);
             if(NavigationManager.class.isAssignableFrom(getNavigationManager().getClass())){
+                log.debug("reloading current view");
                 getNavigationManager().reloadCurrentView();
                 eventBus.publishEvent(new AuthenticationSuccessEvent(userName));
             }
@@ -70,6 +87,20 @@ public class LoginPresenter extends AbstractPresenter<LoginView> {
     }
 
 
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onViewEnter() {
+        super.onViewEnter();
+        // attempt to auto login
+        if(StringUtils.isNotEmpty(System.getProperty(PROPNAME_USER)) && StringUtils.isNotEmpty(System.getProperty(PROPNAME_PASSWORD))){
+            log.warn("Performing autologin with user " + System.getProperty(PROPNAME_USER));
+            authenticate(System.getProperty(PROPNAME_USER), System.getProperty(PROPNAME_PASSWORD));
+        }
+    }
+
     @EventListener
     protected void onLoginEvent(AuthenticationAttemptEvent e){
         authenticate(e.getUserName(), getView().getLoginDialog().getPassword().getValue());
