예제 #1
0
        public bool grant_type(SeekOauthKey key)
        {
            string           url  = "http://192.168.1.202/oauth/access_token";
            List <Parameter> pars = new List <Parameter>();

            pars.Add(new Parameter("grant_type", "refresh_token"));
            pars.Add(new Parameter("client_id", key.CustomKey));
            pars.Add(new Parameter("client_secret", key.CustomSecret));
            pars.Add(new Parameter("refresh_token", key.RefreshTokenKey));
            SeekRequest request       = new SeekRequest();
            string      requeststring = request.SyncRequest(url, "POST", pars, null);

            SeekOauthKey.TokenKey = GetJsonValue(requeststring, "access_token");
            key.RefreshTokenKey   = GetJsonValue(requeststring, "refresh_token");
            if (SeekOauthKey.TokenKey == null)
            {
                return(false);
            }
            return(true);
        }