Supported Protocol: All
Syntax: USR trId TWN S ticket @author Roger Chen
239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
{ try { if(protocol.before(MsnProtocol.MSNP13)) { OutgoingUSRAuthNS outgoing = new OutgoingUSRAuthNS( protocol); //log.debug("MSNDEBUG: Time to request the login ticket for auth"); String ticket = getLoginTicket(getPassportUrl(), messenger.getOwner().getEmail() .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!")); ((AbstractMessenger)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!")); ((AbstractMessenger)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); } } catch (IOException e) {
239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
{ try { if(protocol.before(MsnProtocol.MSNP13)) { OutgoingUSRAuthNS outgoing = new OutgoingUSRAuthNS( protocol); //log.debug("MSNDEBUG: Time to request the login ticket for auth"); String ticket = getLoginTicket(getPassportUrl(), messenger.getOwner().getEmail() .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); } } catch (IOException e) {