.getEmailAddress(),
((MsnOwnerImpl) messenger.getOwner())
.getPassword(), getAuthStr());
if (ticket == null) {
((AbstractMessenger) messenger)
.fireExceptionCaught(new IncorrectPasswordException());
return;
}
outgoing.setTicket(ticket);
messenger.send(outgoing);
}
else
{
String nonce = getNonce();
String policy = getPolicy();
// must logout and throw exception or something
if(nonce == null)
{
((AbstractMessenger)messenger).
fireExceptionCaught(
new LoginException(
"Login Failed, nonce is missing!"));
// let client do the logout, may need to do it
// asynchronous from here
//messenger.logout();
return;
}
MsnOwner owner = session.getMessenger().getOwner();
if(!(owner instanceof MsnOwnerImpl))
return;
String username = owner.getEmail().getEmailAddress();
String pass = ((MsnOwnerImpl)owner).getPassword();
SSO sso = session.createSSO(username, pass, policy, nonce);
String ticket = sso.getTicket();
// must logout and throw exception or something
if(ticket == null)
{
((AbstractMessenger)messenger).
fireExceptionCaught(
new LoginException(
"Login Failed, error making ticket!"));
// let client do the logout, may need to do it
// asynchronous from here
//messenger.logout();
return;
}
MsnMessenger messenger = session.getMessenger();
OutgoingUSRAuthNS outgoing = new OutgoingUSRAuthNS(
protocol);
if (ticket == null)
{
((AbstractMessenger) messenger)
.fireExceptionCaught(new IncorrectPasswordException());
return;
}
outgoing.setTicket(ticket);
messenger.send(outgoing);
}