Examples of AccountException


Examples of com.google.gerrit.server.account.AccountException

    env.put(Context.SECURITY_CREDENTIALS, password != null ? password : "");
    env.put(Context.REFERRAL, referral != null ? referral : "ignore");
    try {
      return new InitialDirContext(env);
    } catch (NamingException e) {
      throw new AccountException("Incorrect username or password", e);
    }
  }
View Full Code Here

Examples of com.google.gerrit.server.account.AccountException

      res.addAll(accountQuery.query(ctx, params));
    }

    switch (res.size()) {
      case 0:
        throw new AccountException("No such user:" + username);

      case 1:
        return res.get(0);

      default:
        throw new AccountException("Duplicate users: " + username);
    }
  }
View Full Code Here

Examples of javax.security.auth.login.AccountException

    /**
     * @tests javax.security.auth.login.AccountException#AccountException(
     *        java.lang.String)
     */
    public final void testCtor2() {
        assertNull(new AccountException(null).getMessage());

        String message = "";
        assertSame(message, new AccountException(message).getMessage());

        message = "message";
        assertSame(message, new AccountException(message).getMessage());
    }
View Full Code Here

Examples of javax.security.auth.login.AccountException

public class AccountExceptionTest extends SerializationTest {

    @Override
    protected Object[] getData() {
        return new Object[] {new AccountException("message")};
    }
View Full Code Here

Examples of javax.security.auth.login.AccountException

    /**
     * @tests javax.security.auth.login.AccountException#AccountException()
     */
    public final void testCtor1() {
        assertNull(new AccountException().getMessage());
    }
View Full Code Here

Examples of javax.security.auth.login.AccountException

    /**
     * @tests javax.security.auth.login.AccountException#AccountException(
     *        java.lang.String)
     */
    public final void testCtor2() {
        assertNull(new AccountException(null).getMessage());

        String message = "";
        assertSame(message, new AccountException(message).getMessage());

        message = "message";
        assertSame(message, new AccountException(message).getMessage());
    }
View Full Code Here

Examples of javax.security.auth.login.AccountException

public class AccountExceptionTest extends SerializationTest {

    @Override
    protected Object[] getData() {
        return new Object[] {new AccountException("message")};
    }
View Full Code Here

Examples of org.apache.shiro.authc.AccountException

      String currentCaptcha = (String) session.getAttribute(getSessionCaptchaKeyAttribute());
      //获取用户输入的验证码
      String submitCaptcha = getCaptcha(request);
      //如果验证码不匹配,登录失败
      if (StringUtils.isEmpty(submitCaptcha) || !StringUtils.equals(currentCaptcha,submitCaptcha.toLowerCase())) {
        return onLoginFailure(this.createToken(request, response), new AccountException("验证码不正确"), request, response);
      }
   
    }
   
    return super.executeLogin(request, response);
View Full Code Here

Examples of org.apache.shiro.authc.AccountException

        UsernamePasswordToken upToken = (UsernamePasswordToken) token;
        String username = upToken.getUsername();

        // Null username is invalid
        if (username == null) {
            throw new AccountException("Null usernames are not allowed by this realm.");
        }

        Connection conn = null;
        SimpleAuthenticationInfo info = null;
        try {
View Full Code Here

Examples of org.apache.shiro.authc.AccountException

    String username = ((UsernamePasswordToken) token).getUsername();
    log.info("Attempting to authenticate " + username + " in DB realm...");

    // Null username is invalid
    if (username == null) {
      throw new AccountException(
          "Null usernames are not allowed by this realm.");
    }

    // Get the user with the given username. If the user is not
    // found, then they don't have an account and we throw an
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.