0 Replies Latest reply on Nov 17, 2009 3:37 PM by mike82

    Auto-authentication for development

    mike82
      Click HELP for text formatting instructions. Then edit this text and check the previewhi,

         i want to set up my application to login me at start for development purposes. I just don't want each time I redeploy app to go to login form and click login. How can I do this? I wasted some hours trying to achieve this, without success. My latest idea:

      (class Authenticator)

      public boolean developerLogin() {         
               credentials.setUsername("admin");
               credentials.setPassword("password");         
               return authenticate();
      }

      and components.xml (tried many combinations of below)

      <event type="org.jboss.seam.security.notLoggedIn">
        <action execute="#{redirect.captureCurrentView}"/>
        <action execute="#{authenticator.developerLogin}" />
        <action execute="#{redirect.returnToCapturedView}"/>
      </event>

      results in:

      15:34:40,106 ERROR [Exceptions] handled and logged exception
      org.jboss.seam.security.NotLoggedInException
           at org.jboss.seam.security.Identity.checkRestriction(Identity.java:217)
           at org.jboss.seam.navigation.Page.checkPermission(Page.java:263)
           at org.jboss.seam.navigation.Page.preRender(Page.java:283)
           at org.jboss.seam.navigation.Pages.preRender(Pages.java:350)
           at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
           at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
      ....

      Then I am redirected to login page. But when I try again same page requested 1st time, I am logged in! But not big help as I am redirected to login anyway, and then have to re-type requested url...