return true;
}
public byte[] evaluateChallenge(byte[] challenge) throws SaslException {
if (challenge.length > 0) {
throw new SaslException("Unexpected server challenge");
}
NameCallback nameCallback = new NameCallback("Enter name");
Callback[] callbacks = new Callback[] { nameCallback };
try {
callbackHandler.handle(callbacks);
} catch (UnsupportedCallbackException e) {
throw new SaslException("Unsupported callback: " + e);
} catch (IOException e) {
throw new SaslException("Failed to execute callback: " + e);
}
String email = nameCallback.getName();
XoauthSaslResponseBuilder responseBuilder = new XoauthSaslResponseBuilder();
Exception caughtException = null;
try {
byte[] rv = responseBuilder.buildResponse(email,
protocol,
oauthToken,
oauthTokenSecret,
consumer);
isComplete = true;
return rv;
} catch (IOException e) {
caughtException = e;
} catch (OAuthException e) {
caughtException = e;
} catch (URISyntaxException e) {
caughtException = e;
}
throw new SaslException("Threw an exception building XOAUTH string: " +
caughtException);
}