Created
March 28, 2013 12:06
-
-
Save kayalshri/5262641 to your computer and use it in GitHub Desktop.
Hotmail, MSN, Live oauth2 PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
@author : Giriraj Namachivayam | |
@date : Mar 20, 2013 | |
@demourl : http://ngiriraj.com/socialMedia/oauthlogin/msn.php | |
@document : http://ngiriraj.com/work/hotmail-connect-by-using-oauth/ | |
@license : Free to use, | |
@History : V1.0 - Released oauth 2.0 service providers login access | |
@oauth2 : Support following oauth2 login | |
Bitly | |
Wordpress | |
Paypal | |
Microsoft(MSN,Live,Hotmail) | |
Foursquare | |
Box | |
Yammer | |
Yandex | |
*/ | |
include "socialmedia_oauth_connect.php"; | |
$oauth = new socialmedia_oauth_connect(); | |
$oauth->provider="Microsoft"; | |
$oauth->client_id = "xxxxxxxxxxxxxxxxxxxxxxx"; | |
$oauth->client_secret = "xxxxxxxxxxxxxxxxxxxxxx"; | |
$oauth->scope="wl.basic wl.emails wl.birthday wl.skydrive wl.photos"; | |
$oauth->redirect_uri ="http://ngiriraj.com/socialMedia/oauthlogin/msn.php"; | |
$oauth->Initialize(); | |
$code = ($_REQUEST["code"]) ? ($_REQUEST["code"]) : ""; | |
if(empty($code)) { | |
$oauth->Authorize(); | |
}else{ | |
$oauth->code = $code; | |
# print $oauth->getAccessToken(); | |
$getData = json_decode($oauth->getUserProfile()); | |
$oauth->debugJson($getData); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment