Microsoft adds XMPP support to Windows Live Messenger

This are great news for the XMPP community. Microsoft has added XMPP client support to their Windows Live servers. You can read the announcement here.

Microsoft does not support any of the mandatory SASL mechanisms SCRAM, DIGEST-MD5 and PLAIN. Instead they have implemented their own X-MESSENGER-OAUTH2 SASL mechanism. This means that all existing XMPP Software is not able to connect to their server without code changes or updates.

I have updated the MatriX library to support the X-MESSENGER-OAUTH2 SASL mechanism. You can download the latest binary here.

Here is an example how you can connect to Windows Live Messenger with MatriX.
The XMPP domain is Microsoft has the proper SRV records, so MatriX discovers the hostname automatically. All you have to do is subscribe to the OnBeforeSasl event and disable the the automatic SASL mechanism selection and choose the X_MESSENGER_OAUTH2 mechanism for authentication. Additional you have to pass SaslProperties which include your access token.

var xmppClient = new XmppClient {XmppDomain = ""};
xmppClient.OnBeforeSasl += xmppClient_OnBeforeSasl;

private void xmppClient_OnBeforeSasl(object sender, SaslEventArgs e)
	e.Auto = false;

	const string ACCESS_TOKEN = "your_access_token";
	e.SaslMechanism = SaslMechanism.X_MESSENGER_OAUTH2;
	e.SaslProperties = new LiveMessengerProperties
							   AccessToken = ACCESS_TOKEN

Of course you must retrieve your access token before you can connect with MatriX.

Some additional useful resources from Microsoft:

Leave a comment


  1. Is it possible to login to Windows Live Messenger (retrieve your access token?) without using webbrowser component?

    As i understand, all flows require usage of some webbrowser to let user input his password on the website, but not in program. Am i right?

  2. All Microsoft examples use the webbrowser.
    A browser is only a GUI with webrequests under the hood. So it must be possible with only webrequests as well, but I have no examples for this.

  3. Does the windows phone mango versions support the X-MESSENGER-OAUTH2?, I see that they were last updated in May and April (before this update).

  4. thEpisode Productions

    How to get the Access Token with Silverlight? in this link retrive the Token with C# for Apps Metro and JavaScript :cry: thanks

  5. I’m not sure if there’s anything I’m doing wrong (or right for that matter). I’ve tried adding WLM to my current project, however all I get is the connection getting closed.

    I have facebook login working fine as well as classic xmpp services. With WLM, however, the only event that gets called is OnClose. Not even OnBeforeSASL is reached. Any clues on this? Also, I’ve tried manually adding the hostname, aside from letting the SRV records handle it,( but with not success.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.