my app dont ready shiro.ini. I'm using a VRaptor framework , just not this slow shiro.ini . this on the classpath and does not read .
public LoginController() {
Factory<SecurityManager> factory = new IniSecurityManagerFactory();
SecurityManager securityManager = factory.getInstance();
SecurityUtils.setSecurityManager(securityManager);
}
public boolean autenticar(String email, String password, Boolean rememberMe) throws NoSuchAlgorithmException, UnsupportedEncodingException {
UsernamePasswordToken token = new UsernamePasswordToken(email, password);
token.setRememberMe(true);
Subject subject = SecurityUtils.getSubject();
try {
subject.login(token);
} catch ( UnknownAccountException uae ) {
System.out.println(uae.getMessage());
} catch ( IncorrectCredentialsException ice ) {
System.out.println(ice.getMessage());
} catch ( LockedAccountException lae ) {
System.out.println(lae.getMessage());
} catch ( ExcessiveAttemptsException eae ){
System.out.println(eae.getMessage());
}
result.redirectTo(LoginController.class).admin();
return false;
}
src/main/webapp/web-inf/shiro.ini
Aucun commentaire:
Enregistrer un commentaire