-
Notifications
You must be signed in to change notification settings - Fork 0
journal 2020 09 10: Getting very very stuck with the passthru OAuth proxy idea
Eason Chen edited this page Sep 10, 2020
·
1 revision
I did write an ad-hoc call to Twitter's API for sending a tweet, and it's working:
But when I try to add in my proxy layer, nothing is working. See commit 142988178ba6a8d426e23c0818765ef33505aebe.
Error message:
withTwitterApiCall produced this signed request, ready to go: Request {
host = "api.twitter.com"
port = 443
secure = True
requestHeaders = [("Accept","*/*"),("Accept-Language","en-US,en;q=0.5"),("Accept-Encoding","gzip, deflate"),("Content-Type","application/x-www-form-urlencoded;charset=UTF-8"),("Connection","keep-alive"),("Authorization","<REDACTED>")]
path = "/1.1/statuses/update.json"
queryString = ""
method = "POST"
proxy = Nothing
rawBody = False
redirectCount = 0
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
withTwitterApiCall received this response: Response {responseStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, responseVersion = HTTP/1.1, responseHeaders = [("cache-control","no-cache, no-store, must-revalidate, pre-check=0, post-check=0"),("content-disposition","attachment; filename=json.json"),("content-encoding","gzip"),("content-length","98"),("content-type","application/json;charset=utf-8"),("date","Thu, 10 Sep 2020 15:22:14 GMT"),("expires","Tue, 31 Mar 1981 05:00:00 GMT"),("last-modified","Thu, 10 Sep 2020 15:22:14 GMT"),("pragma","no-cache"),("server","tsa_l"),("set-cookie","personalization_id=\"v1_jOzDyziECgV6qHr5LGb0Uw==\"; Max-Age=63072000; Expires=Sat, 10 Sep 2022 15:22:14 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None"),("set-cookie","lang=en; Path=/"),("set-cookie","guest_id=v1%3A159975133480387216; Max-Age=63072000; Expires=Sat, 10 Sep 2022 15:22:14 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None"),("status","403 Forbidden"),("strict-transport-security","max-age=631138519"),("x-access-level","read-write"),("x-connection-hash","5c1625b2fb67c9274b651e7ff2b15aaa"),("x-content-type-options","nosniff"),("x-frame-options","SAMEORIGIN"),("x-response-time","167"),("x-transaction","00b1915c00fd643c"),("x-twitter-response-tags","BouncerCompliant"),("x-xss-protection","0")], responseBody = "{\"errors\":[{\"code\":170,\"message\":\"Missing required parameter: status.\"}]}", responseCookieJar = CJ {expose = [Cookie {cookie_name = "guest_id", cookie_value = "v1%3A159975133480387216", cookie_expiry_time = 2022-09-10 15:22:14.903963 UTC, cookie_domain = "twitter.com", cookie_path = "/", cookie_creation_time = 2020-09-10 15:22:14.903963 UTC, cookie_last_access_time = 2020-09-10 15:22:14.903963 UTC, cookie_persistent = True, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = False},Cookie {cookie_name = "lang", cookie_value = "en", cookie_expiry_time = 3020-01-12 00:00:00 UTC, cookie_domain = "api.twitter.com", cookie_path = "/", cookie_creation_time = 2020-09-10 15:22:14.903963 UTC, cookie_last_access_time = 2020-09-10 15:22:14.903963 UTC, cookie_persistent = False, cookie_host_only = True, cookie_secure_only = False, cookie_http_only = False},Cookie {cookie_name = "personalization_id", cookie_value = "\"v1_jOzDyziECgV6qHr5LGb0Uw==\"", cookie_expiry_time = 2022-09-10 15:22:14.903963 UTC, cookie_domain = "twitter.com", cookie_path = "/", cookie_creation_time = 2020-09-10 15:22:14.903963 UTC, cookie_last_access_time = 2020-09-10 15:22:14.903963 UTC, cookie_persistent = True, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = False}]}, responseClose' = ResponseClose}
The error says "Missing required parameter: status.". However, it's not easy to inspect the request before sending it:
The answers are suggesting that I use wireshark.