Package org.apache.wicket.authentication

Examples of org.apache.wicket.authentication.IAuthenticationStrategy


  protected void onConfigure()
  {
    // logged in already?
    if (isSignedIn() == false)
    {
      IAuthenticationStrategy authenticationStrategy = getApplication().getSecuritySettings()
        .getAuthenticationStrategy();
      // get username and password from persistence store
      String[] data = authenticationStrategy.load();

      if ((data != null) && (data.length > 1))
      {
        // try to sign in the user
        if (signIn(data[0], data[1]))
        {
          username = data[0];
          password = data[1];

          onSignInRemembered();
        }
        else
        {
          // the loaded credentials are wrong. erase them.
          authenticationStrategy.remove();
        }
      }
    }

    super.onConfigure();
View Full Code Here


     * @see org.apache.wicket.markup.html.form.Form#onSubmit()
     */
    @Override
    public final void onSubmit()
    {
      IAuthenticationStrategy strategy = getApplication().getSecuritySettings()
        .getAuthenticationStrategy();

      if (signIn(getUsername(), getPassword()))
      {
        if (rememberMe == true)
        {
          strategy.save(username, password);
        }
        else
        {
          strategy.remove();
        }

        onSignInSucceeded();
      }
      else
      {
        onSignInFailed();
        strategy.remove();
      }
    }
View Full Code Here

  protected void onConfigure()
  {
    // logged in already?
    if (isSignedIn() == false)
    {
      IAuthenticationStrategy authenticationStrategy = getApplication().getSecuritySettings()
        .getAuthenticationStrategy();
      // get username and password from persistence store
      String[] data = authenticationStrategy.load();

      if ((data != null) && (data.length > 1))
      {
        // try to sign in the user
        if (signIn(data[0], data[1]))
        {
          username = data[0];
          password = data[1];

          onSignInRemembered();
        }
        else
        {
          // the loaded credentials are wrong. erase them.
          authenticationStrategy.remove();
        }
      }
    }

    super.onConfigure();
View Full Code Here

     * @see org.apache.wicket.markup.html.form.Form#onSubmit()
     */
    @Override
    public final void onSubmit()
    {
      IAuthenticationStrategy strategy = getApplication().getSecuritySettings()
        .getAuthenticationStrategy();

      if (signIn(getUsername(), getPassword()))
      {
        if (rememberMe == true)
        {
          strategy.save(username, password);
        }
        else
        {
          strategy.remove();
        }

        onSignInSucceeded();
      }
      else
      {
        onSignInFailed();
        strategy.remove();
      }
    }
View Full Code Here

   */
  @Override
  protected void onConfigure() {
    // logged in already?
    if (isSignedIn() == false) {
      IAuthenticationStrategy authenticationStrategy = getApplication().getSecuritySettings()
          .getAuthenticationStrategy();
      // get username and password from persistence store
      String[] data = authenticationStrategy.load();

      if ((data != null) && (data.length > 1)) {
        // try to sign in the user
        if (signInRemembered(data[0], data[1])) {
          username = data[0];
          password = data[1];

          onSignInRemembered();
        } else {
          // the loaded credentials are wrong. erase them.
          authenticationStrategy.remove();
        }
      }
    }

    super.onConfigure();
View Full Code Here

    /**
     * @see org.apache.wicket.markup.html.form.Form#onSubmit()
     */
    @Override
    public final void onSubmit() {
      IAuthenticationStrategy strategy = getApplication().getSecuritySettings().getAuthenticationStrategy();

      if (signIn(getUsername(), getPassword())) {
        if (rememberMe == true) {
          strategy.save(username, password);
        } else {
          strategy.remove();
        }

        onSignInSucceeded();
      } else {
        onSignInFailed();
        strategy.remove();
      }
    }
View Full Code Here

  protected void onBeforeRender()
  {
    // logged in already?
    if (isSignedIn() == false)
    {
      IAuthenticationStrategy authenticationStrategy = getApplication().getSecuritySettings()
        .getAuthenticationStrategy();
      // get username and password from persistence store
      String[] data = authenticationStrategy.load();

      if ((data != null) && (data.length > 1))
      {
        // try to sign in the user
        if (signIn(data[0], data[1]))
        {
          username = data[0];
          password = data[1];

          // logon successful. Continue to the original destination
          continueToOriginalDestination();
          // Ups, no original destination. Go to the home page
          throw new RestartResponseException(getSession().getPageFactory().newPage(
            getApplication().getHomePage()));
        }
        else
        {
          // the loaded credentials are wrong. erase them.
          authenticationStrategy.remove();
        }
      }
    }

    // don't forget
View Full Code Here

     * @see org.apache.wicket.markup.html.form.Form#onSubmit()
     */
    @Override
    public final void onSubmit()
    {
      IAuthenticationStrategy strategy = getApplication().getSecuritySettings()
        .getAuthenticationStrategy();

      if (signIn(getUsername(), getPassword()))
      {
        if (rememberMe == true)
        {
          strategy.save(username, password);
        }
        else
        {
          strategy.remove();
        }

        onSignInSucceeded();
      }
      else
      {
        onSignInFailed();
        strategy.remove();
      }
    }
View Full Code Here

  protected void onBeforeRender()
  {
    // logged in already?
    if (isSignedIn() == false)
    {
      IAuthenticationStrategy authenticationStrategy = getApplication().getSecuritySettings()
        .getAuthenticationStrategy();
      // get username and password from persistence store
      String[] data = authenticationStrategy.load();

      if ((data != null) && (data.length > 1))
      {
        // try to sign in the user
        if (signIn(data[0], data[1]))
        {
          username = data[0];
          password = data[1];

          // logon successful. Continue to the original destination
          if (!continueToOriginalDestination())
          {
            // Ups, no original destination. Go to the home page
            throw new RestartResponseException(getSession().getPageFactory().newPage(
              getApplication().getHomePage()));
          }
        }
        else
        {
          // the loaded credentials are wrong. erase them.
          authenticationStrategy.remove();
        }
      }
    }

    // don't forget
View Full Code Here

     * @see org.apache.wicket.markup.html.form.Form#onSubmit()
     */
    @Override
    public final void onSubmit()
    {
      IAuthenticationStrategy strategy = getApplication().getSecuritySettings()
        .getAuthenticationStrategy();

      if (signIn(getUsername(), getPassword()))
      {
        if (rememberMe == true)
        {
          strategy.save(username, password);
        }
        else
        {
          strategy.remove();
        }

        onSignInSucceeded();
      }
      else
      {
        onSignInFailed();
        strategy.remove();
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.authentication.IAuthenticationStrategy

Copyright © 2018 www.massapicom. 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.