Question

I was able to import user's contacts:

        $url = 'https://apis.live.net/v5.0/me/contacts?access_token='.$accesstoken.'';
        $xmlresponse =  curl_file_get_contents($url);
        $xml = json_decode($xmlresponse, true);
        foreach($xml['data'] as $emails)
        {
                echo '<br><br>';
                echo $emails['name'].' '.$emails['email_hashes'][0];

        }

The thing is that I want to find the connections the user might have in my network. A hotmail doesn't provide the plain text email (and that it looks one way encryption)..

How can I encrypt my emails the same way to compare them? is there any other work around this?

Was it helpful?

Solution

my solution was to extenD the scope: Then more fields where recived in the result

https://login.live.com/oauth20_authorize.srf?client_id={APPID}&`scope=wl.signin%20wl.basic%20wl.emails%20wl.contacts_emails&response_type=code&redirect_uri=http://{REDIRECT_URI}`

OTHER TIPS

According to the documentation for generating the hashes, you can generate the hash by first trim()-ing your appid and the email, concatenating them together as UTF-8 and generating the sha256 hash of the concatenated string.

Something like (pseudoish code), assuming both appid and email are valid utf-8:

function get_hotmail_hash($email, $appId)
{
    $content = mb_strtolower(trim($email) . trim($appId), "utf-8");
    return hash("sha256", $content);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top