MyBB Community Forums

Full Version: [TUTORIAL]Integrate Windows Live Logins with MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
This tutorial will show you how to integrate Windows Live logins with MyBB. Users will be able to log in with Twitter. If the visitor has never visited before it will automatically make an account for that user. If the visitor has visited before it will log that user in.

See the similar tutorial for Twitter here: http://community.mybboard.net/thread-65544.html

Requirements:
A server with PHP5, SQLite, and the mhash and mcrypt PHP modules
A set of Application and Secret keys from Windows Live(
Note: Return URL for the Windows Live app should be http://domain.com/forumdir/webauth-handler.php

Steps:

First, in the Admin CP, go to Templates & Style > Templates > Add Template

Give this new Template the following title:
Quote:wlregisteruname

Fill it in with the following HTML(edit where necessary)
 <html>
<head>
<title>Screeze: Select a username</title>
{$headerinclude}
<script type="text/javascript"> 
function process(f){
var now = new Date();
f.timezone.value = now.gettimezoneoffset();
return true;
}
</script>
</head>
<body>
{$header}
Hey! It appears this is the first time you are logging into Screeze with your Windows Live ID. Please select a username to use on Screeze and we'll log you in.<br/>
<form action="./wlregister.php" method="post" onsubmit="return process(this)">
Desired Username:<input name="username" type="text" value="">
<input name="timezone" type="hidden" value="0">
<input value="Submit" type="submit">
</form>
<p>By clicking submit you acknowledge that you are over 13 and accept the Screeze Privacy Policy & Terms of Service.</p>
{$footer}
</body>
</html>
Save the template.


Now go to Configuration>Custom Profile Fields

Note the highest ID number currently listed.

Go to Add New Profile Field

Set the New Field to the following information:

Title: Windows Live UID
Desc: UID
Type: Textbox
MaxLength: 65535
FieldLength: 0
Options: [Blank]
Display Order: One more than the ID you noted (Note this new number as well)
Required: No
Editable: No
Hide: Yes

Save this field and Add another

Set the New Field to the following information:

Title: Registered with Windows Live ID
Desc: Registered
Type: Textbox
MaxLength: 65535
FieldLength: 0
Options: [Blank]
Display Order: One more than the second ID you noted (Note this new number as well)
Required: No
Editable: No
Hide: Yes

Save this field

Keep those two new IDs in a safe place for later.

Upload the wlregister.php file from the attached archive to your forum root. Edit the file where necessary.
NOTE: fid9 and fid10 should be changed with their respective fid numbers that you noted down, in order(Only replace the number part, leave fid there).

Upload the Application-Key.xml file from the attached archive to a place on your server that is not web-accessible. If there is no such place, chmod the file so that public access is impossible. Edit where necessary.

Upload wlconfig.php to your forum root. Edit the file where necessary.

Upload webauth-handler.php from the attached archive to your forum root.

Upload windowslivelogin.php from the attached archive to your forum root.

You may now direct your guests to login to their Windows Live connected accounts or register using Windows Live with the following url:
http://login.live.com/wlogin.srf?appid=Y...wsignin1.0


Also note that users registered from Windows Live will not have a proper email address set in their profile. You may ask these users after registration to provide one.

The Windows Live API and most other scripts in this package are © Microsoft Corporation.

The wlregister script however is my own(although registration and login is based off of the functions from MyBB's own scripting) and all I ask is that I am credited if anyone asks how the integration was accomplished and that the code is not sold to others(I think you may be breaking other licenses if you do as well but I am not sure).A mention on your site either on the Windows Live connection pages, footer, or in any kind of announcement about the Windows Live connectivity on your site with a link to http://screeze.com would be appreciated as well, but that's in no way required.

If anything isn't working right it may have been something I missed in this tutorial, so please let me know.
Cool will try Wink
how do I get the windows key id?
Visit www.Live.Azure.com and register.
Site does not exist
(2010-02-27, 10:28 PM)DARKNESSDH Wrote: [ -> ]Site does not exist

I think the caps might be messing it up.

Try https://live.azure.com
thank you!, but I have a little problem

Fatal error: Call to undefined function mhash() in /home/armyz/public_html/foro/windowslivelogin.php on line 1515

what i do?
(2010-02-27, 10:38 PM)ArmyZ Wrote: [ -> ]thank you!, but I have a little problem

Fatal error: Call to undefined function mhash() in /home/armyz/public_html/foro/windowslivelogin.php on line 1515

what i do?

If you make a simple php file with the following command
print_r (get_loaded_extensions());

Does mhash show as part of the list?

If it doesn't I don't think your PHP install has the extension needed or wasn't compiled with support for it.
thank you very much

I could already do it,

is very good,

but that url I can send my users to register?

are you left with?
https://login.live.com/wlogin.srf?appid= [b]here id?[/b] &alg=wsignin1.0&lc=3082
Yes, put your Application ID from Windows Live at that spot in the URL, and you should be all set.

Make sure to use the Application ID, not the Secret Key.
Pages: 1 2 3 4 5