「twitter アカウントでサインイン」機能をサイトに統合しています。
それで、https://twitter.com/oauth/request_token にリクエストを送信し、トークンを取得して、https://twitter.com/oauth/authenticate?oauth_token=%oauth_token% にリダイレクトします。
次に、oauth_token と oauth_verifier でコールバックを受け取ります
これはうまくいきます。
しかし、承認されたクライアントの詳細を取得するには、https://api.twitter.com/1/account/verify_credentials.json を呼び出す必要があります。
私は送信しています:
GET https ://api.twitter.com/1/account/verify_credentials.json
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: q=0.8,en-us;q=0.5,en;q=0.3
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
X-Auth-Service-Provider: https ://api.twitter.com/1/account/verify_credentials.json
X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/", oauth_signature="acYFjEgUrTcyb4FMBoJF8MlwZGw%3D", oauth_timestamp="1286899670", oauth_consumer_key="%CONSUMER_KEY%", oauth_nonce="268310006", oauth_token="%oauth_token%", oauth_version="1.0", oauth_signature_method="HMAC-SHA1"
%oauth_token% - token got when twitter redirects me back the cleint
%CONSUMER_KEY% - my twitter account's consumer key
そして戻ってくる
HTTP/1.1 401 Unauthorized
Cache-Control: no-cache, max-age=300
Connection: close
Date: Tue, 12 Oct 2010 16:07:45 GMT
Server: hi
Vary: Accept-Encoding
WWW-Authenticate: Basic realm="Twitter API"
{"error":"Could not authenticate you.","request":"/1/account/verify_credentials.json"}
ここで何が問題なのか、誰か教えてもらえますか?
ありがとう!