Esempio n. 1
0
        /// <summary>获取access token 重载
        /// Gets the access token.
        /// </summary>
        /// <param name="url">The URL.</param>
        /// <param name="verifier">The verifier.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public bool GetAccessToken(string url, string verifier)
        {
            List <Parameter> parameters = new List <Parameter>();

            this.verify = verifier;

            QWeiboRequest request = new QWeiboRequest();

            return(ParseToken(request.SyncRequest(url, "GET", this, parameters, null)));;
        }
Esempio n. 2
0
        /// <summary>获取request token 重载
        ///
        /// </summary>
        /// <param name="requesturl">The requesturl.</param>
        /// <param name="callback">The callback.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public bool GetRequestToken(string requesturl, string callback)
        {
            List <Parameter> parameters = new List <Parameter>();

            if (string.IsNullOrEmpty(callback))
            {
                callbackUrl = "http://www.qq.com";
            }

            QWeiboRequest request = new QWeiboRequest();

            return(ParseToken(request.SyncRequest(urlRequesToken, "GET", this, parameters, null)));
        }
Esempio n. 3
0
        public string GetAccessToken()
        {
            var request = new QWeiboRequest();
            var result  = request.SyncRequest(
                this.Oauthkey2,
                this.Oauthkey2.urlAccessToken,
                "GET",
                new List <Parameter>()
            {
                new Parameter(
                    "grant_type",
                    "authorization_code"),
                new Parameter("code", Oauthkey2.code),
                new Parameter("redirect_uri", this.Oauthkey2.callbackUrl),
                new Parameter("client_id", this.Oauthkey2.appKey),
                new Parameter("client_secret", this.Oauthkey2.appSecret)
            },
                null);

            Oauthkey2.ParseToken(result);

            return(Oauthkey2.tokenKey);
        }
Esempio n. 4
0
        public string GetAccessToken()
        {
            var request=new QWeiboRequest();
            var result = request.SyncRequest(
                this.Oauthkey2,
                this.Oauthkey2.urlAccessToken,
                "GET",
                new List<Parameter>()
                    {
                        new Parameter(
                            "grant_type",
                            "authorization_code"),
                            new Parameter("code", Oauthkey2.code),
                            new Parameter("redirect_uri",this.Oauthkey2.callbackUrl),
                            new Parameter("client_id",this.Oauthkey2.appKey),
                            new Parameter("client_secret",this.Oauthkey2.appSecret)
                    },
                null);

            Oauthkey2.ParseToken(result);

            return Oauthkey2.tokenKey;
        }
Esempio n. 5
0
    private bool GetRequestToken(string customerKey, string customerSecret)
    {
        string url = "https://open.t.qq.com/cgi-bin/request_token";
        List<QWeiboSDK.Parameter> parameters = new List<QWeiboSDK.Parameter>();
        OauthKey oauthKey = new OauthKey();
        oauthKey.customKey = customerKey;
        oauthKey.customSecret = customerSecret;
        oauthKey.callbackUrl = ConfigurationManager.AppSettings["CallbackUrl_QQ"];       //"http://localhost:20595";
        QWeiboRequest request = new QWeiboRequest();

        return ParseToken(request.SyncRequest(url, "GET", oauthKey, parameters, null));

    }
Esempio n. 6
0
    private bool GetAccessToken(string customerKey, string customerSecret, string requestToken, string requestTokenSecrect, string verify)
    {
        string url = "https://open.t.qq.com/cgi-bin/access_token";
        List<QWeiboSDK.Parameter> parameters = new List<QWeiboSDK.Parameter>();

        OauthKey oauthKey = new OauthKey();
        oauthKey.customKey = customerKey;

        oauthKey.customSecret = customerSecret;

        oauthKey.tokenKey = requestToken;

        oauthKey.tokenSecret = requestTokenSecrect;

        oauthKey.verify = verify;

        QWeiboRequest request = new QWeiboRequest();

        return ParseToken(request.SyncRequest(url, "GET", oauthKey, parameters, null));

    }
        /// <summary>获取request token 重载
        /// 
        /// </summary>
        /// <param name="requesturl">The requesturl.</param>
        /// <param name="callback">The callback.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public bool GetRequestToken(string requesturl, string callback)
        {
            List<Parameter> parameters = new List<Parameter>();
            if(string.IsNullOrEmpty(callback))
            {
                callbackUrl = "http://www.qq.com";
            }

             QWeiboRequest request = new QWeiboRequest();
             return ParseToken(request.SyncRequest(urlRequesToken, "GET", this, parameters, null));
        }
        /// <summary>获取access token 重载
        /// Gets the access token.
        /// </summary>
        /// <param name="url">The URL.</param>
        /// <param name="verifier">The verifier.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public bool GetAccessToken(string url, string verifier)
        {
            List<Parameter> parameters = new List<Parameter>();
              this.verify = verifier;

              QWeiboRequest request = new QWeiboRequest();

              return ParseToken(request.SyncRequest(url, "GET", this, parameters, null));;
        }
        private bool GetRequestToken(string customKey, string customSecret)
        {
            string url = "https://open.t.qq.com/cgi-bin/request_token";
            List<Parameter> parameters = new List<Parameter>();
            OauthKey oauthKey = new OauthKey();
            oauthKey.customKey = customKey;
            oauthKey.customSecret = customSecret;
            oauthKey.callbackUrl = "http://www.qq.com";

            QWeiboRequest request = new QWeiboRequest();
            return ParseToken(request.SyncRequest(url, "GET", oauthKey, parameters, null));
        }