First creat a Application on Hotmail go to:-
https://account.live.com/developers/applications

Click on the Create Applicatin then open form and fill all details.
Get Client Id and Client Secret For API
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
include_once("hotmail/live_connect.inc.php");$cnt_live = new MocrosoftLiveCnt(array( 'client_id' => 'xxxxxxxxxxxxx', 'client_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'client_scope' => 'wl.basic wl.emails',));if(!isset($_GET["code"])){ //$loginUrl = $cnt_live->GetLoginUrl(); header('Location: '.$cnt_live->GetLoginUrl());}//https://login.live.com/oauth20_authorize.srf?client_id=xxxxxxxxxxxxxxxx&scope=wl.basic wl.emails wl.birthday&response_type=code&redirect_uri=http://www.site.com/hotmail-login.php;$user_info = $cnt_live->getUser();if(!$user_info && isset($_GET["code"])){ $access_token=""; $access_token = $cnt_live->getAccessToken($_GET["code"]); $cnt_live->setAccessToken($access_token); header('Location: '.$cnt_live->GetRedirectUrl());}if(isset($_GET["logout"])){ $cnt_live->distroySession(); header('Location: '.$cnt_live->GetRedirectUrl());}if($user_info){ $res=array(); if(isset($user_info->emails->account)) $res['email'] = $user_info->emails->account; if(isset($user_info->first_name)) $res['users_fname']=$user_info->first_name; if(isset($user_info->last_name)) $res['users_lname']=$user_info->last_name; $res['id']=$user_info->id; print_r($res);}else{ //show login button header('Location: '.$cnt_live->GetRedirectUrl());} |