本文整理汇总了Java中javax.security.sasl.AuthenticationException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationException.getMessage方法的具体用法?Java AuthenticationException.getMessage怎么用?Java AuthenticationException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.security.sasl.AuthenticationException
的用法示例。
在下文中一共展示了AuthenticationException.getMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAuthenticationException06
import javax.security.sasl.AuthenticationException; //导入方法依赖的package包/类
/**
* Test for <code>AuthenticationException(String detail, Throwable ex)</code> constructor
* Assertion: constructs AuthenticationException when <code>ex</code> is not null
* <code>detail</code> is null
*/
public void testAuthenticationException06() {
AuthenticationException tE = new AuthenticationException(null, tCause);
if (tE.getMessage() != null) {
String toS = tCause.toString();
String getM = tE.getMessage();
assertTrue("getMessage() must should ".concat(toS), (getM
.indexOf(toS) != -1));
}
assertEquals("getCause() must return ".concat(tCause.toString()),
tE.getCause(), tCause);
}
示例2: authenticate
import javax.security.sasl.AuthenticationException; //导入方法依赖的package包/类
/**
*
* This method Will authenticate the user by the password they provide. Will either
* return true, false or will throw an
* AuthenticationException.
*
* This implementation is currently using CSM via LDAP to authenticate.
* Authorization is done through the CSM tables with the application database
* @param userName
* @param password
* @return
* @throws AuthenticationException
*/
public boolean authenticate(String userName, String password) throws AuthenticationException{
boolean authenticated;
try {
authenticated = localAuthenticate(userName,password);
}catch(AuthenticationException ae) {
throw new AuthenticationException(ae.getMessage());
}
return authenticated;
}