Package com.iisigroup.cap.security.model

Examples of com.iisigroup.cap.security.model.CapUserDetails


    }
    return null;
  }

  public static Locale getLocale() {
    CapUserDetails user = getUser();
    Locale locale = null;
    if (user != null) {
      locale = user.getLocale();
    }
    if (locale == null) {
      locale = Locale.getDefault();
    }
    return locale;
View Full Code Here


    }
    return roleOids;
  }

  private static CapUserDetails getDefautlUserDetails() {
    CapUserDetails user = new CapUserDetails();
    String userId = "";
    try {
      userId = InetAddress.getLocalHost().getHostName();
    } catch (java.net.UnknownHostException uhe) {
      userId = "UNKNOWN";
    }
    user.setUserId(userId);
    user.setUserName(userId);
    user.setUnitNo("999");
    return user;
  }// ;
View Full Code Here

    }

    public UserDetails obtainUserDetails(IUser user, String password,
            Map<String, String> roles) {
        return new CapUserDetails(user, password, roles);
    }
View Full Code Here

            } else {
                captchaPassed = true;
            }
            if (captchaPassed) {
                resetCaptchaFields();
                CapUserDetails user;
                try {
                    user = (CapUserDetails) userService
                            .loadUserByUsername(username);
                } catch (Exception e) {
                    throw new CapAuthenticationException(e.getMessage(),
                            captchaEnabled, forceChangePwd);
                }
                boolean currentPwdVerified = verifyPassword(username,
                        authentication.getCredentials().toString(),
                        user.getPassword());
                if (currentPwdVerified) {
                    setWrountCount(username, 0);
                    String authedPwd = checkStatus(user, username, password,
                            policy, captchaEnabled, forceChangePwd);
                    // 登入成功
                    setForceChangePwd(username, false);
                    // 檢核是否要提醒使用者變更密碼
                    notifyPasswordChange(username, captchaEnabled,
                            forceChangePwd);
                    accessControlService.login(username);
                    return new UsernamePasswordAuthenticationToken(user,
                            authedPwd, user.getAuthorities());
                } else {
                    setWrountCount(username, getWrountCount(username) + 1);
                    // 連錯 N 次,enable captcha
                    if (wrongCount >= Integer.parseInt(policy
                            .get(PwdPloicyKeys.PWD_CAPTCHA_ENABLE.toString()
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.security.model.CapUserDetails

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.