Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HttpClient client = new HttpClient();
- string myUser = "my user";
- string myPass = "my pass";
- string clientId = "my client id";
- string redirectUri = "my redirect uri";
- FormUrlEncodedContent form = new FormUrlEncodedContent(new Dictionary<string, string> {
- { "username", myUser }, { "password", myPass }
- });
- Task<HttpResponseMessage> message = client.PostAsync("https://public-api.wordpress.com/oauth2/authorize?client_id=your_client_id" +
- clientId + "&redirect_uri=" + redirectUri + "&response_type=code", form);
- String result = message.Result.Content.ReadAsStringAsync().Result;
- JObject obj = JObject.Parse(result);
- string token = (string)obj["access_token"];
- string refreshToken = (string)obj["refresh_token"];
- Invalid request, please go back and try again.
- Error Code: invalid_client
- Error Message: Unknown client_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement