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

     * @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
  public boolean isSignedIn() {
    if (userId < 1) {
      IAuthenticationStrategy strategy = getAuthenticationStrategy();
      // get username and password from persistence store
      String[] data = strategy.load();
      if ((data != null) && (data.length > 2)) {
        // try to sign in the user
        if (!signIn(data[0], data[1], data[2])) {
          // the loaded credentials are wrong. erase them.
          strategy.remove();
        }
      }
    }
    return userId > -1;
  }
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()))
      {
        onSignInSucceeded();

        if (rememberMe == true)
        {
          strategy.save(username, password);
        }
        else
        {
          strategy.remove();
        }
      }
      else
      {
        onSignInFailed();
        strategy.remove();
      }
    }
View Full Code Here

      super(id);
     
      if (WebSession.get().isSignedIn()) {
        alreadyLoggedIn();
      } else {
        IAuthenticationStrategy strategy = getApplication().getSecuritySettings().getAuthenticationStrategy();
        // get username and password from persistence store
        String[] data = strategy.load();

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

            alreadyLoggedIn();
          } else {
            // the loaded credentials are wrong. erase them.
            strategy.remove();
          }
        }
      }
      add(new FeedbackPanel("feedback"));
      add(new RequiredTextField<String>("login", new PropertyModel<String>(this, "login")));
View Full Code Here

      throw new RestartResponseException(Application.get().getHomePage());
    }
   
    @Override
    protected void onSubmit() {
      IAuthenticationStrategy strategy = getApplication().getSecuritySettings().getAuthenticationStrategy();
      if (WebSession.get().signIn(login, password)) {
        WebSession.get().setArea(area);
         setResponsePage(Application.get().getHomePage());
        if (rememberMe) {
          strategy.save(login, password);
        } else {
          strategy.remove();
        }
      } else {
        strategy.remove();
      }
    }
View Full Code Here

  }

  @Override
  public boolean isSignedIn() {
    if (userId < 1) {
      IAuthenticationStrategy strategy = getAuthenticationStrategy();
      // get username and password from persistence store
      String[] data = strategy.load();
      if ((data != null) && (data.length > 2)) {
        // try to sign in the user
        if (!signIn(data[0], data[1], data[2])) {
          // the loaded credentials are wrong. erase them.
          strategy.remove();
        }
      }
    }
    return userId > -1;
  }
View Full Code Here

  }

  @Override
  public boolean isSignedIn() {
    if (userId < 1) {
      IAuthenticationStrategy strategy = getAuthenticationStrategy();
      // get username and password from persistence store
      String[] data = strategy.load();
      if (data != null && data.length > 3 && data[2] != null) {
        Long domainId = null;
        try {
          domainId = Long.parseLong(data[3]);
        } catch (Exception e) {
          //no-op
        }
        // try to sign in the user
        if (!signIn(data[0], data[1], Type.valueOf(data[2]), domainId)) {
          // the loaded credentials are wrong. erase them.
          strategy.remove();
        }
      }
    }
    return userId > -1;
  }
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()))
      {
        onSignInSucceeded();

        if (rememberMe == true)
        {
          strategy.save(username, password);
        }
        else
        {
          strategy.remove();
        }
      }
      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.