示例#1
0
        public ThreeLoginUserInfo UserInfo(string access_token, string uid)
        {
            url  = "https://api.weibo.com/2/users/show.json";
            data = string.Format("access_token={0}&uid={1}", access_token, uid);
            string result = HttpHelp.HttpGet(url + "?" + data);

            return(Json.ToObject <WeiboUserInfo>(result));
        }
示例#2
0
        public AccessToken AccessToken(string code)
        {
            url  = " https://api.weibo.com/oauth2/access_token";
            data = string.Format("grant_type=authorization_code&client_id={0}&client_secret={1}&code={2}&redirect_uri={3}", appKey, appSecret, code, redirect_uri);
            string result = HttpHelp.HttpPost(url + "?" + data);

            return(Json.ToObject <WeiboAccessToken>(result));
        }
示例#3
0
        public ThreeLoginUserInfo UserInfo(string access_token, string uid)
        {
            url  = "https://openapi.baidu.com/rest/2.0/passport/users/getInfo";
            data = string.Format("access_token={0}", access_token);
            string result = HttpHelp.HttpGet(url + "?" + data);

            return(Json.ToObject <BaiduUserInfo>(result));
        }
示例#4
0
        /// <summary>
        /// 使用Refresh Token获取Access Token
        /// </summary>
        /// <param name="refresh_token"></param>
        /// <returns></returns>
        public BaiduAccessToken UpdateAccessToken(string refresh_token)
        {
            url  = "https://openapi.baidu.com/oauth/2.0/token";
            data = string.Format("grant_type=refresh_token&client_id={0}&client_secret={1}&refresh_token={2}", appKey, appSecret, refresh_token);
            string result = HttpHelp.HttpPost(url + "?" + data);

            return(Json.ToObject <BaiduAccessToken>(result));
        }
示例#5
0
 public string Authorize()
 {
     url  = "https://api.weibo.com/oauth2/authorize";
     data = string.Format("client_id={0}&redirect_uri={1}&response_type=code", appKey, redirect_uri);
     return(HttpHelp.HttpGet(url + "?" + data));
 }