/** * Merges the specified <code>AuthenticationInfo</code> into this <code>Account</code>. * <p/> * If the specified argument is also an instance of {@link SimpleAccount SimpleAccount}, the * {@link #isLocked()} and {@link #isCredentialsExpired()} attributes are merged (set on this instance) as well * (only if their values are <code>true</code>). * * @param info the <code>AuthenticationInfo</code> to merge into this account. */ public void merge(AuthenticationInfo info) { authcInfo.merge(info); // Merge SimpleAccount specific info if (info instanceof SimpleAccount) { SimpleAccount otherAccount = (SimpleAccount) info; if (otherAccount.isLocked()) { setLocked(true); } if (otherAccount.isCredentialsExpired()) { setCredentialsExpired(true); } } }
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { UsernamePasswordToken upToken = (UsernamePasswordToken) token; SimpleAccount account = getUser(upToken.getUsername()); if (account != null) { if (account.isLocked()) { throw new LockedAccountException("Account [" + account + "] is locked."); } if (account.isCredentialsExpired()) { String msg = "The credentials for account [" + account + "] are expired"; throw new ExpiredCredentialsException(msg); } } return account; }
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { UsernamePasswordToken upToken = (UsernamePasswordToken) token; SimpleAccount account = getUser(upToken.getUsername()); if (account != null) { if (account.isLocked()) { throw new LockedAccountException("Account [" + account + "] is locked."); } if (account.isCredentialsExpired()) { String msg = "The credentials for account [" + account + "] are expired"; throw new ExpiredCredentialsException(msg); } } return account; }
/** * Merges the specified <code>AuthenticationInfo</code> into this <code>Account</code>. * <p/> * If the specified argument is also an instance of {@link SimpleAccount SimpleAccount}, the * {@link #isLocked()} and {@link #isCredentialsExpired()} attributes are merged (set on this instance) as well * (only if their values are <code>true</code>). * * @param info the <code>AuthenticationInfo</code> to merge into this account. */ public void merge(AuthenticationInfo info) { authcInfo.merge(info); // Merge SimpleAccount specific info if (info instanceof SimpleAccount) { SimpleAccount otherAccount = (SimpleAccount) info; if (otherAccount.isLocked()) { setLocked(true); } if (otherAccount.isCredentialsExpired()) { setCredentialsExpired(true); } } }
/** * Merges the specified <code>AuthenticationInfo</code> into this <code>Account</code>. * <p/> * If the specified argument is also an instance of {@link SimpleAccount SimpleAccount}, the * {@link #isLocked()} and {@link #isCredentialsExpired()} attributes are merged (set on this instance) as well * (only if their values are <code>true</code>). * * @param info the <code>AuthenticationInfo</code> to merge into this account. */ public void merge(AuthenticationInfo info) { authcInfo.merge(info); // Merge SimpleAccount specific info if (info instanceof SimpleAccount) { SimpleAccount otherAccount = (SimpleAccount) info; if (otherAccount.isLocked()) { setLocked(true); } if (otherAccount.isCredentialsExpired()) { setCredentialsExpired(true); } } }
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { UsernamePasswordToken upToken = (UsernamePasswordToken) token; SimpleAccount account = getUser(upToken.getUsername()); if (account != null) { if (account.isLocked()) { throw new LockedAccountException("Account [" + account + "] is locked."); } if (account.isCredentialsExpired()) { String msg = "The credentials for account [" + account + "] are expired"; throw new ExpiredCredentialsException(msg); } } return account; }
@Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authToken) throws AuthenticationException { OAuth2Token token = (OAuth2Token) authToken; SimpleAccount account = authorizationServer.getAccountFromAccessToken(token.getToken()); if (account != null) { if (account.isLocked()) { throw new LockedAccountException("Account [" + account + "] is locked."); } if (account.isCredentialsExpired()) { String msg = "The credentials for account [" + account + "] are expired"; throw new ExpiredCredentialsException(msg); } } return account; }