PHP Access MSN Contacts (using Windows Live ID delegated authentication SDK) ____php

Source: Internet
Author: User
Tags curl web services

On the Internet to see some of the practice of MSN Contact, personal found that most of the practice is not the official way, I would like to share my implementation.

There are generally 3 ways to access MSN contacts:

1: Through the MSN Agreement to get contacts, this way there are many online, the data is relatively stable, but there is a disadvantage, this way will be the line of the MSN user T off.

2: Through the simulation of the Windows Live ID (formerly hotmail.com Mailbox), there will be a list of contacts, which is characterized by speed, but not stable, the need to maintain regular code to maintain consistency in the server, and the other access to the contact will be in the MSN discrepancy, In addition, for newly registered MSN users, the contact cannot be reached unless Windows Live is opened.

3: Get contacts through Microsoft Web Services published in previous years, the process is to assemble the MSN username and password into an XML file and put it to https://dev.login.live.com/ WSTLOGIN.SRF, then get an encryption verification using the Wsse:binarysecuritytoken, and finally put this wsse:binarysecuritytoken in the head of the page authorization:wlid1.0 t= " BinarySecurityToken "to https://cumulus.services.live.com/". $liveid. "/livecontacts/contacts/. This was stable and fast in the past, but Microsoft should have recently changed or canceled the service and switched to the rest framework, which is currently popular.

Here's another way I used to say the rest, which is actually the Windows Live ID delegated authentication SDK.

The steps are as follows:

(1) Open https://msm.live.com/app/as prompted, register a Windows Live ID to obtain a Windows Application ID, and register to return to an azure Services Developer Portal page, similar to my capture below:

I've registered two application IDs (now named Project), so I've shown two project. For everyone should be choosing the new project/live services:existing APIs to get a application ID. The following figure:

Here to explain, domain to fill out the site you want to use the service domain name, reetrun URL is when the login to verify the MSN account after the return of some data to your program URL, this URL is really there. After the submission is successful, you receive the following information:

Application ID: 00163fff8000a800
Domain (s): www.example.com
Return URL: http://www.example.com/delauth-handler.php
Secret Key: Qo8na7clfnxd1cnmflmprlqgwulvplr1


This information is used in the following steps.

(2) Download My source code (suggest you best download try the Official SDK, which contains a simple example), I have encapsulated the code, put the code to the Reetrun URL corresponding directory, modify the Config.xml value for you just applied for the key, Domain and Reetrun URLs, and so on.

Then index.php enter the corresponding MSN account password, access to this index.php can get contact person.

The PHP5 version (PHP4) is required in this way, and the curl extension of PHP needs to be opened. This approach is reliable and speeds up to 4 of this curl operation. Finally hope that this source is helpful to everyone.

SOURCE Download Address: Http://power2php2.googlecode.com/files/windowsliveContacts1.0.zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.