项目地址:https://github.com/netnr/Netnr.Login

接入地址:https://apps.dev.microsoft.com

帮助文档:http://msdn.microsoft.com/zh-CN/library/live

接入步骤

code

//获取 access_token
var accessToken_ResultEntity = MicroSoft.AccessToken(new MicroSoft_AccessToken_RequestEntity()
{
    code = Request.Query["code"]
});

//获取 user
var user_ResultEntity = MicroSoft.User(new MicroSoft_User_RequestEntity()
{
    access_token = accessToken_ResultEntity.access_token
});

//身份唯一标识
string openId = user_ResultEntity.id.ToString();
if (string.IsNullOrWhiteSpace(openId))
{
    throw new Exception("身份验证失败");
}

留言

ˆ