Examples of SecondaryLoginContext


Examples of org.apache.wicket.security.hive.authentication.SecondaryLoginContext

    mock.assertRenderedPage(SecondaryLoginPage.class);
    form = mock.newFormTester("form");
    form.setValue("username", "test");
    form.submit();
    mock.assertRenderedPage(VerySecurePage.class);
    assertTrue(((WaspSession) mock.getWicketSession()).logoff(new SecondaryLoginContext()));
    mock.startPage(mock.getLastRenderedPage());
    mock.assertRenderedPage(application.getApplicationSettings().getAccessDeniedPage());
    // access denied because the page is already constructed
  }
View Full Code Here

Examples of org.apache.wicket.security.hive.authentication.SecondaryLoginContext

    // attempt logoff
    WaspSession waspSession = ((WaspSession) mock.getWicketSession());
    assertNotSame(session, waspSession);
    // instead of simulating a different jvm we can make sure the hashcode
    // always stays the same
    SecondaryLoginContext logoff = new SecondaryLoginContext();
    assertEquals(22889663, logoff.hashCode());
    assertTrue(waspSession.logoff(logoff));
    mock.startPage(lastRendered);
    mock.assertRenderedPage(application.getApplicationSettings().getAccessDeniedPage());
  }
View Full Code Here

Examples of org.apache.wicket.security.hive.authentication.SecondaryLoginContext

   */
  public boolean login(String username)
  {
    try
    {
      LoginContext context = new SecondaryLoginContext();
      ((WaspSession) Session.get()).login(context);
      if (!continueToOriginalDestination())
        setResponsePage(Application.get().getHomePage());
      return true;
    }
View Full Code Here

Examples of org.wicketstuff.security.hive.authentication.SecondaryLoginContext

    mock.assertRenderedPage(SecondaryLoginPage.class);
    form = mock.newFormTester("form");
    form.setValue("username", "test");
    form.submit();
    mock.assertRenderedPage(VerySecurePage.class);
    assertTrue(((WaspSession)mock.getSession()).logoff(new SecondaryLoginContext()));
    mock.startPage(mock.getLastRenderedPage());
    mock.assertRenderedPage(application.getApplicationSettings().getAccessDeniedPage());
    // access denied because the page is already constructed
  }
View Full Code Here

Examples of org.wicketstuff.security.hive.authentication.SecondaryLoginContext

    // attempt logoff
    WaspSession waspSession = ((WaspSession)mock.getSession());
    assertNotSame(session, waspSession);
    // instead of simulating a different jvm we can make sure the hashcode
    // always stays the same
    SecondaryLoginContext logoff = new SecondaryLoginContext();
    assertEquals(22889663, logoff.hashCode());
    assertTrue(waspSession.logoff(logoff));
    mock.startPage(lastRendered);
    mock.assertRenderedPage(application.getApplicationSettings().getAccessDeniedPage());
  }
View Full Code Here

Examples of org.wicketstuff.security.hive.authentication.SecondaryLoginContext

   */
  public boolean login(String username)
  {
    try
    {
      LoginContext context = new SecondaryLoginContext();
      ((WaspSession)Session.get()).login(context);
      continueToOriginalDestination();

      // or
      setResponsePage(Application.get().getHomePage());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.