}
}
byte[] decodedSecret = Base64.decode(secret);
if (decodedSecret == null)
throw new RejectException();
int usernameStop = -1;
for (int i = 1; i < decodedSecret.length && usernameStop < 0; i++)
{
if (decodedSecret[i] == 0)
{
usernameStop = i;
}
}
String username = new String(decodedSecret, 1, usernameStop - 1);
String password = new String(decodedSecret, usernameStop + 1,
decodedSecret.length - usernameStop - 1);
try
{
helper.login(username.toString(), password);
resetState();
}
catch (LoginFailedException lfe)
{
resetState();
throw new RejectException();
}
ctx.setCredential(new Credential(username));
return true;
}