List of usage examples for org.apache.shiro.authc ConcurrentAccessException ConcurrentAccessException
public ConcurrentAccessException()
From source file:com.gamewin.weixin.service.account.ShiroDbRealm.java
License:Apache License
/** * ?,./*from ww w . ja v a2 s . c om*/ */ @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken) throws AuthenticationException { UsernamePasswordToken token = (UsernamePasswordToken) authcToken; User user = accountService.findUserByLoginName(token.getUsername()); if (user != null) { if ("disabled".equals(user.getStatus())) { throw new DisabledAccountException(); } else if ("Audit".equals(user.getStatus())) { throw new ConcurrentAccessException(); } byte[] salt = Encodes.decodeHex(user.getSalt()); return new SimpleAuthenticationInfo( new ShiroUser(user.getId(), user.getLoginName(), user.getName(), user.getRoles()), user.getPassword(), ByteSource.Util.bytes(salt), getName()); } else { return null; } }