Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/NotificationSession.java27
-rw-r--r--protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java7
2 files changed, 23 insertions, 11 deletions
diff --git a/protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/NotificationSession.java b/protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/NotificationSession.java
index 2749d6698..0cbcd83fe 100644
--- a/protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/NotificationSession.java
+++ b/protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/NotificationSession.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Remy Suen <remy.suen@gmail.com> - initial API and implementation
+ * Cagatay Calli <ccalli@gmail.com> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=196812
******************************************************************************/
package org.eclipse.ecf.protocol.msn;
@@ -102,24 +103,30 @@ final class NotificationSession extends DispatchSession {
.getParam(3));
password = null;
- write("USR", "TWN S " + ticket); //$NON-NLS-1$ //$NON-NLS-2$
- ticket = null;
- String input = super.read();
- if (!input.startsWith("USR")) { //$NON-NLS-1$
- throw new ConnectException(
- "An error occurred while attempting to authenticate "
- + "with the Tweener server.");
+ if(ticket == null){
+ throw new ConnectException("Wrong username and/or password.");
}
+ else {
+ write("USR", "TWN S " + ticket); //$NON-NLS-1$ //$NON-NLS-2$
+ ticket = null;
+ String input = super.read();
+ if (!input.startsWith("USR")) { //$NON-NLS-1$
+ throw new ConnectException(
+ "An error occurred while attempting to authenticate "
+ + "with the Tweener server.");
+ }
- retrieveBuddyList();
- this.username = username;
- return true;
+ retrieveBuddyList();
+ this.username = username;
+ return true;
+ }
} else if (!response.getCommand().equals("XFR")) { //$NON-NLS-1$
throw new ConnectException("Unable to connect to the MSN server.");
} else {
alternateServer = response.getParam(2);
return false;
}
+
}
private void retrieveBuddyList() throws IOException {
diff --git a/protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java b/protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java
index d1701b9e9..ead17bbea 100644
--- a/protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java
+++ b/protocols/bundles/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/internal/net/ClientTicketRequest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Remy Suen <remy.suen@gmail.com> - initial API and implementation
+ * Cagatay Calli <ccalli@gmail.com> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=196812
******************************************************************************/
package org.eclipse.ecf.protocol.msn.internal.net;
@@ -87,7 +88,7 @@ public final class ClientTicketRequest {
* the user's password
* @param challengeString
* the challenge string received from the notification session
- * @return the client ticket
+ * @return the client ticket if login info is correct, <code>null</code> otherwise
* @throws IOException
* If an I/O error occurs while connecting to the Passport Nexus
* page or when getting the response codes from the connection
@@ -120,6 +121,10 @@ public final class ClientTicketRequest {
daLoginURL = daLoginURL.substring(1, daLoginURL
.length() - 1);
}
+ else if(request.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED){
+ request.disconnect();
+ return null;
+ }
}
} catch (Exception e) {
if (request.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {

Back to the top