本文整理了Java中org.acegisecurity.BadCredentialsException.getCause()
方法的一些代码示例,展示了BadCredentialsException.getCause()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BadCredentialsException.getCause()
方法的具体详情如下:
包路径:org.acegisecurity.BadCredentialsException
类名称:BadCredentialsException
方法名:getCause
暂无
代码示例来源:origin: jenkinsci/active-directory-plugin
Throwable t = e.getCause();
if (t instanceof CommunicationException) {
return FormValidation.error(e, "Any Domain Controller is reachable");
代码示例来源:origin: org.acegisecurity/acegi-security
private LdapUserDetails bindWithDn(String userDn, String username, String password) {
LdapTemplate template = new LdapTemplate(getInitialDirContextFactory(), userDn, password);
try {
LdapUserDetailsImpl.Essence user = (LdapUserDetailsImpl.Essence) template.retrieveEntry(userDn,
getUserDetailsMapper(), getUserAttributes());
user.setUsername(username);
user.setPassword(password);
return user.createUserDetails();
} catch (BadCredentialsException e) {
// This will be thrown if an invalid user name is used and the method may
// be called multiple times to try different names, so we trap the exception
// unless a subclass wishes to implement more specialized behaviour.
handleBindException(userDn, username, e.getCause());
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!