After wading through the OpenID module and the recently released Windows Live ID Web authentication SDK- I realized that a module to authenticate into drupal via Windows Live was going to be a lot simpler to put together than the OpenID module is. It took me half a day to pull this together. You can download the module in its beta form here at http://www.hyrme.com/files/winliveid-1.0.zip.
Installation Instructions:
Links
Windows Live ID Web Authentication SDK documentation http://go.microsoft.com/fwlink/?LinkID=91762
Download latest version from http://drupal.org/project/winliveid
Before you Install/Use
1. mcrypt and mhash extensions for PHP - required to decrypt information sent and received by the windows live service.
2. clean URLS - windows live service needs a redirection url to jump to on the drupal installation. this URL cannot contain query arguments (& and ?). If you are not able to install clean URL there are a couple of workarounds:
a) rewrite rules in your .htaccess file for just the callback url
b) use the webauth-handler.php file as a proxy and stick it in your document
directory with appropriate modifications.
Install
1. Copy to your modules directory
2. Register and get your key from microsoft - You will need a couple of things before you can get your key.
a) Your own windows live account
- create one right then or use your hotmail/msn account if you have one.
b) A secret pass code - you will be prompted for this and will need to update the XML file on your server with this pass code.
c) The callback URL for the windows live service that handles the login and logout calls. This will be
"http://your_site_name/drupal_suffix_if_any/winliveid/handler"
replace with your sitename and any drupal path suffix if present.
If you do not have CLEAN URLS and cannot have CLEAN URLS - use the included webauth-handler.php file as a proxy and stick it in your document root and your callback URL then will be:
"http://your_site_name/path_to_webauth_handler.php"
Remember to modify the webauth-handler file.
OR
3. If you want to play around without registering setup the webauth-handler.php file as per the instructions in it.
This will let you use the sample windows id key and has a workaround for you to use without getting your key.
4. If you have your key and passcode edit the ApplicationKey.xml file and enter them there per instruction from the windows live. If you are testing the sample - leave the xml file as is.
5. Enable the module and you should be ready to go. You should see the "Windows Live ID" Sign In link on the login block.
6a. For a new user to the site - if they choose to login via Windows Live - It will prompt them to create a new user on your site and go through the steps you have setup for registering a new user.
6b. Existing users on your site can setup to login via windows live by going to their "account page" and clicking on the "Windows Live ID" tab
Bugs
1. the module does not yet remember state - ie where you were when you logged in through windows live - it will always dump you back to the default home page. The windows live authentication mechanism is closed and a bit quirky. I am trying to figure out the best way to fix this.
Not logging in
Hey,
Thanks for the module!
I installed it, enabled mcrypt and mhash in PHP, I got the appid and all of that set up.
But, when I click on "sign in with live id" it takes to the live id sign in page, allows me to sign in, and then takes me back to my main page.
The problem is that when I get back to the main page, I am not signed in!
I don't get any errors either.
How can I resolve this issue?
Having trouble installing
Hi Hyrme,
Thanks for all the great work with the Windows Live ID integration into drupal, I am just having some trouble installing it. I am running PHP 5.8.7 and everytime I try to enable the module within my drupal 5.3 it has an error:
Winlive ID Requires PHP5 and above to work. The Windows Live ID SDK that this module depends on is provided by the Windows Live ID service and is only compatible with PHP5. (Currently using )I thought it might be that I am missing the required extensions for PHP. Can I install them into a cgi-bin directory, or do I need admin access to the php installation? (which I don't have)
You could disable the check
You could disable the check for PHP5 if you are sure it exists.. file winliveid.install comment out lines 18,19.
$requirements['php']['severity'] = REQUIREMENT_ERROR;$requirements['php']['description'] = t('Winlive ID Requ..)