Package org.apache.shiro.authc

Examples of org.apache.shiro.authc.LockedAccountException


            } catch (UnknownAccountException uae) {
                throw new UnknownAccountException("Authentication Failed. There is no user with username of " + token.getPrincipal(), uae.getCause());
            } catch (IncorrectCredentialsException ice) {
                throw new IncorrectCredentialsException("Authentication Failed. Password for account " + token.getPrincipal() + " was incorrect!", ice.getCause());
            } catch (LockedAccountException lae) {
                throw new LockedAccountException("Authentication Failed. The account for username " + token.getPrincipal() + " is locked."
                    + "Please contact your administrator to unlock it.", lae.getCause());
            } catch (AuthenticationException ae) {
                throw new AuthenticationException("Authentication Failed.", ae.getCause());
            }
        }
View Full Code Here


    String username = principalCollection.getPrimaryPrincipal().toString();
    User user = dao().fetch(User.class, Cnd.where("name", "=", username));
        if (user == null)
            return null;
        if (user.isLocked())
            throw new LockedAccountException("Account [" + username + "] is locked.");
       
        SimpleAuthorizationInfo auth = new SimpleAuthorizationInfo();
        auth.setRoles(user.getRoleStrSet());
        auth.addStringPermissions(user.getPermissionStrSet());
       
View Full Code Here

    UsernamePasswordToken upToken = (UsernamePasswordToken) token;
    User user = dao().fetch(User.class, Cnd.where("name", "=", upToken.getUsername()));
        if (user == null)
            return null;
        if (user.isLocked())
            throw new LockedAccountException("Account [" + upToken.getUsername() + "] is locked.");
        dao().fetchLinks(user, null);
        SimpleAccount account = new SimpleAccount(upToken.getUsername(), user.getPasswd(), name);
        if (user.getSalt() != null)
            account.setCredentialsSalt(ByteSource.Util.bytes(user.getSalt()));
        return account;
View Full Code Here

            } catch (UnknownAccountException uae) {
                throw new UnknownAccountException("Authentication Failed. There is no user with username of " + token.getPrincipal(), uae.getCause());
            } catch (IncorrectCredentialsException ice) {
                throw new IncorrectCredentialsException("Authentication Failed. Password for account " + token.getPrincipal() + " was incorrect!", ice.getCause());
            } catch (LockedAccountException lae) {
                throw new LockedAccountException("Authentication Failed. The account for username " + token.getPrincipal() + " is locked."
                        + "Please contact your administrator to unlock it.", lae.getCause());
            } catch (AuthenticationException ae) {
                throw new AuthenticationException("Authentication Failed.", ae.getCause());
            }
        }
View Full Code Here

            } catch (UnknownAccountException uae) {
                throw new UnknownAccountException("Authentication Failed. There is no user with username of " + token.getPrincipal(), uae.getCause());
            } catch (IncorrectCredentialsException ice) {
                throw new IncorrectCredentialsException("Authentication Failed. Password for account " + token.getPrincipal() + " was incorrect!", ice.getCause());
            } catch (LockedAccountException lae) {
                throw new LockedAccountException("Authentication Failed. The account for username " + token.getPrincipal() + " is locked."
                    + "Please contact your administrator to unlock it.", lae.getCause());
            } catch (AuthenticationException ae) {
                throw new AuthenticationException("Authentication Failed.", ae.getCause());
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.shiro.authc.LockedAccountException

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.