public boolean verifyCredentials(String user, String key) throws RemoteException,AuthenticationException
{
String password = null;
if ( crypto != null )
{
try
{
password = crypto.deCrypt(key);
}
catch (CryptoGraphException e)
{
e.printStackTrace();
password = key;
}
}
//authenticate the user using RADIUS server and return the status
//relAuthenAPI.init(authRelAPI);
isVerified = RadiusUtil.getInstance().authenticateUser(user,password);
if(isVerified)
{
userProp = relAuthenAPI.getAllUserAttributes(user,"NULL");
System.err.println("userProp is : "+userProp);
String userStatus = (String)userProp.get("status");
if(userStatus.equals("passwordExpired"))
{
throw new AuthenticationException(AuthenticationException.PASSWORD_EXPIRED,AdventNetResourceBundle.getInstance().getString("Password Expired"));
}
else if(userStatus.equals("new"))
{
throw new AuthenticationException(AuthenticationException.FIRST_LOGIN,AdventNetResourceBundle.getInstance().getString("First Login"));
}
}
else
{
return false;
}
return true;
}