Re: [twitter-dev] Request token failed

2011-03-30 Thread Nassr zied
i also got this problem, but i just deleted the consumerkey and the
consummerkeySecret and typed them again and from nowhere it works again!!
try it ;)

2011/3/30 Matthieu GD matthie...@gmail.com

 Hello,

 From out of nowhere I got Failed to validate oauth signature and
 token when I do a request token (GET with https on this url :
 https://api.twitter.com/oauth/request_token). It was working since
 several days.

 Is it normal ?

 Matthieu

 --
 Twitter developer documentation and resources: http://dev.twitter.com/doc
 API updates via Twitter: http://twitter.com/twitterapi
 Issues/Enhancements Tracker:
 http://code.google.com/p/twitter-api/issues/list
 Change your membership to this group:
 http://groups.google.com/group/twitter-development-talk


-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Request token failed

2011-03-29 Thread Matthieu GD
Hello,

From out of nowhere I got Failed to validate oauth signature and
token when I do a request token (GET with https on this url :
https://api.twitter.com/oauth/request_token). It was working since
several days.

Is it normal ?

Matthieu

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Request Token Failure

2010-09-10 Thread AS_Drone
We have been trying to implement the OAuth Echo method, but cannot get
a request-token. It returns with Failed to validate oauth signature
and token.

Below is our Post data. Our signature aligns with data on the API
document. Any thoughts as to why we fail to oauth signature?


Post data:

Request Header:
POST /oauth/request_token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Authorization:
OAuth oauth_nonce=QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk,
oauth_signature_method=HMAC-SHA1, oauth_timestamp=1272323042,
oauth_consumer_key=XX,
oauth_signature=Sr%2FKoecPb7D%2FnZNxt4qoM517Xjs%3D,
oauth_version=1.0
Host: api.twitter.com
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: k=12.22.61.130.1283734903045073; guest_id=128373490305755705;
__utma=43838368.1906297211.1283734907.1283734907.1283762670.2;
__utmz=43838368.1283734907.1.1.utmcsr=(direct)|utmccn=(direct)|
utmcmd=(n
one); __utmv=43838368.lang%3A%20en; __qca=P0-1782216308-1283735015637;
__utmb=43838368.3.10.1283762670
Response Header:
HTTP/1.1 401 Unauthorized
Date: Mon, 06 Sep 2010 09:13:15 GMT
Server: hi
Status: 401 Unauthorized
X-Transaction: 1283764395-39211-63478
Last-Modified: Mon, 06 Sep 2010 09:13:15 GMT
X-Runtime: 0.00573
Content-Type: text/html; charset=utf-8
Content-Length: 44
Pragma: no-cache
X-Revision: DEV
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0,
post-check=0
Set-Cookie:
_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCKEfUuYqAToHaWQiJWVhY2RjNDQ3NGNmMm
Mw%250ANjUwYWIzMGE3OWE4NDNlZTM3IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy
%250A
OjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--
c7925282fe8f92e14b1a250c09ddff
e386a925be; domain=.twitter.com; path=/
Vary: Accept-Encoding
Connection: close
Failed to validate oauth signature and token

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en


Re: [twitter-dev] Request Token Failure

2010-09-10 Thread Tom van der Woerdt
You don't need request_token for Echo - unless you don't have the user's
credentials yet, but in that case you aren't using OAuth Echo.

Tom


On 9/11/10 1:13 AM, AS_Drone wrote:
 We have been trying to implement the OAuth Echo method, but cannot get
 a request-token. It returns with Failed to validate oauth signature
 and token.
 
 Below is our Post data. Our signature aligns with data on the API
 document. Any thoughts as to why we fail to oauth signature?
 
 
 Post data:
 
 Request Header:
 POST /oauth/request_token HTTP/1.1
 Content-Type: application/x-www-form-urlencoded
 Authorization:
 OAuth oauth_nonce=QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk,
 oauth_signature_method=HMAC-SHA1, oauth_timestamp=1272323042,
 oauth_consumer_key=XX,
 oauth_signature=Sr%2FKoecPb7D%2FnZNxt4qoM517Xjs%3D,
 oauth_version=1.0
 Host: api.twitter.com
 Content-Length: 0
 Connection: Keep-Alive
 Cache-Control: no-cache
 Cookie: k=12.22.61.130.1283734903045073; guest_id=128373490305755705;
 __utma=43838368.1906297211.1283734907.1283734907.1283762670.2;
 __utmz=43838368.1283734907.1.1.utmcsr=(direct)|utmccn=(direct)|
 utmcmd=(n
 one); __utmv=43838368.lang%3A%20en; __qca=P0-1782216308-1283735015637;
 __utmb=43838368.3.10.1283762670
 Response Header:
 HTTP/1.1 401 Unauthorized
 Date: Mon, 06 Sep 2010 09:13:15 GMT
 Server: hi
 Status: 401 Unauthorized
 X-Transaction: 1283764395-39211-63478
 Last-Modified: Mon, 06 Sep 2010 09:13:15 GMT
 X-Runtime: 0.00573
 Content-Type: text/html; charset=utf-8
 Content-Length: 44
 Pragma: no-cache
 X-Revision: DEV
 Expires: Tue, 31 Mar 1981 05:00:00 GMT
 Cache-Control: no-cache, no-store, must-revalidate, pre-check=0,
 post-check=0
 Set-Cookie:
 _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCKEfUuYqAToHaWQiJWVhY2RjNDQ3NGNmMm
 Mw%250ANjUwYWIzMGE3OWE4NDNlZTM3IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy
 %250A
 OjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--
 c7925282fe8f92e14b1a250c09ddff
 e386a925be; domain=.twitter.com; path=/
 Vary: Accept-Encoding
 Connection: close
 Failed to validate oauth signature and token
 

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en


[twitter-dev] Request token out from twitter

2010-07-14 Thread Rendy Pranata
Hi,

I tried to do the request token out from basic, not using any
framework, like MGTwitter, or anything like that. I used objective C
for iPhone for development.

Things that still confused me is, I always get an error

{
NSErrorFailingURLKey = https://api.twitter.com/oauth/
request_token;
NSErrorFailingURLStringKey = https://api.twitter.com/oauth/
request_token;
NSUnderlyingError = Error Domain=kCFErrorDomainCFNetwork
Code=-1012 \The operation couldn\U2019t be completed.
(kCFErrorDomainCFNetwork error -1012.)\ UserInfo=0x783b940 {};
}

I assumed that it is because that the request has not reached your
server yet? cause I was expecting that i got the nice result, saying
that I have a problem with the authentication, or some sort? like
http://oauth.net/core/1.0/#auth_step1

If the request fails verification or is rejected for other reasons,
the Service Provider SHOULD respond with the appropriate response code
as defined in HTTP Response Codes (HTTP Response Codes). The Service
Provider MAY include some further details about why the request was
rejected in the HTTP response body as defined in Service Provider
Response Parameters (Service Provider Response Parameters). 

That was from the OAuth documentation, and because I received an
error, not a error response, can I assume that the problem is in my
code?

NSMutableString *strings = [[NSMutableString alloc] init];
[strings appendString:@OAUTH ];
[strings appendString:@oauth_nonce=\];
[strings appendString:[signatures objectForKey:@oauth_nonce]];
[strings appendString:@\, oauth_callback=\];
[strings appendString:[signatures objectForKey:@oauth_callback]];
[strings appendString:@\, oauth_signature_method=\];
[strings appendString:[signatures
objectForKey:@oauth_signature_method]];
[strings appendString:@\, oauth_timestamp=\];
[strings appendString:[signatures objectForKey:@oauth_timestamp]];
[strings appendString:@\, oauth_consumer_key=\];
[strings appendString:[signatures
objectForKey:@oauth_consumer_key]];
[strings appendString:@\, oauth_signature=\];
[strings appendString:[string stringForURLEncoding]];
[strings appendString:@\, oauth_version=\];
[strings appendString:[signatures objectForKey:@oauth_version]];
[strings appendString:@\];

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
[req setHTTPMethod:@GET];
[req setValue:strings forHTTPHeaderField:@Authorization];

NSHTTPURLResponse *response = nil;
NSError *error = nil;

NSData *responseData = [NSURLConnection sendSynchronousRequest:req

 returningResponse:response

 error:error];
if (response ==nil)
NSLog(@%@, [error userInfo]);
else
{
NSLog(@REPONSE STATUS CODE %d, [response statusCode]);
NSLog(@CONTENT TYPE : %@, [[response allHeaderFields]
 
objectForKey:@Content-Type]);
NSString *payloadAsString = [[NSString alloc]
initWithData:responseData

  encoding:NSUTF8StringEncoding];
NSLog(@CONTENT : %@, payloadAsString);
[payloadAsString release];
}


--
Regards,
Rendy Pranata


Re: [twitter-dev] Request token out from twitter

2010-07-14 Thread Matt Harris
Hi Randy,

We recommend you use an already created library to get OAuth working first.
That way you can see the calls being made, the sort of responses you should
be getting and giving you something to compare your code to. We have a list
of OAuth libraries in different languages (including objective C) on our
developer resources site: http://dev.twitter.com/pages/oauth_libraries

Best,
Matt


On Wed, Jul 14, 2010 at 6:52 AM, Rendy Pranata rendy.pran...@gmail.comwrote:

 Hi,

 I tried to do the request token out from basic, not using any
 framework, like MGTwitter, or anything like that. I used objective C
 for iPhone for development.

 Things that still confused me is, I always get an error

 {
NSErrorFailingURLKey = https://api.twitter.com/oauth/
 request_token;
NSErrorFailingURLStringKey = https://api.twitter.com/oauth/
 request_token;
NSUnderlyingError = Error Domain=kCFErrorDomainCFNetwork
 Code=-1012 \The operation couldn\U2019t be completed.
 (kCFErrorDomainCFNetwork error -1012.)\ UserInfo=0x783b940 {};
 }

 I assumed that it is because that the request has not reached your
 server yet? cause I was expecting that i got the nice result, saying
 that I have a problem with the authentication, or some sort? like
 http://oauth.net/core/1.0/#auth_step1

 If the request fails verification or is rejected for other reasons,
 the Service Provider SHOULD respond with the appropriate response code
 as defined in HTTP Response Codes (HTTP Response Codes). The Service
 Provider MAY include some further details about why the request was
 rejected in the HTTP response body as defined in Service Provider
 Response Parameters (Service Provider Response Parameters). 

 That was from the OAuth documentation, and because I received an
 error, not a error response, can I assume that the problem is in my
 code?

 NSMutableString *strings = [[NSMutableString alloc] init];
[strings appendString:@OAUTH ];
[strings appendString:@oauth_nonce=\];
[strings appendString:[signatures objectForKey:@oauth_nonce]];
[strings appendString:@\, oauth_callback=\];
[strings appendString:[signatures objectForKey:@oauth_callback]];
[strings appendString:@\, oauth_signature_method=\];
[strings appendString:[signatures
 objectForKey:@oauth_signature_method]];
[strings appendString:@\, oauth_timestamp=\];
[strings appendString:[signatures objectForKey:@
 oauth_timestamp]];
[strings appendString:@\, oauth_consumer_key=\];
[strings appendString:[signatures
 objectForKey:@oauth_consumer_key]];
[strings appendString:@\, oauth_signature=\];
[strings appendString:[string stringForURLEncoding]];
[strings appendString:@\, oauth_version=\];
[strings appendString:[signatures objectForKey:@oauth_version]];
[strings appendString:@\];

 NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
 [req setHTTPMethod:@GET];
 [req setValue:strings forHTTPHeaderField:@Authorization];

 NSHTTPURLResponse *response = nil;
NSError *error = nil;

 NSData *responseData = [NSURLConnection sendSynchronousRequest:req

 returningResponse:response

 error:error];
if (response ==nil)
NSLog(@%@, [error userInfo]);
else
{
NSLog(@REPONSE STATUS CODE %d, [response statusCode]);
NSLog(@CONTENT TYPE : %@, [[response allHeaderFields]

 objectForKey:@Content-Type]);
NSString *payloadAsString = [[NSString alloc]
 initWithData:responseData

  encoding:NSUTF8StringEncoding];
NSLog(@CONTENT : %@, payloadAsString);
[payloadAsString release];
}


 --
 Regards,
 Rendy Pranata




-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


Re: [twitter-dev] request token

2010-07-07 Thread Matt Harris
Hi Shob,

We strongly recommend you use a library for handling OAuth with Twitter
until you are comfortable with how OAuth works. For VB I know of at least
one library called TwitterVB: http://twittervb.codeplex.com/

This will do the OAuth heavy lifting for you so you can develop an
application for use with Twitter quickly. If you then want to roll your own
solution you could use the TwitterVB library to compare to the results you
are getting from your function.

Hope that helps,
Matt

On Tue, Jul 6, 2010 at 7:10 AM, Jacky jaga...@gmail.com wrote:


 Hullo,

 POSThttps%3A%2F%2Fapi.twitter.com%2Foauth
 %2Frequest_tokenoauth_callback%3Doob%26oauth_consumer_key
 %3DhUMUUZO3Zx9zNzJ9DghcA%26oauth_nonce
 %3DDA39A3EE5E6B4B0D3255BFEF95601890AFD80709%26oauth_signature_method
 %3DHMAC-SHA1%26oauth_timestamp%3D1277424969%26oauth_version%3D1.0


 and

 Oauth oauth_callback=oob,
 oauth_consumer_key=hUMUUZO3Zx9zNzJ9DghcA,
 oauth_nonce=DA39A3EE5E6B4B0D3255BFEF95601890AFD80709,
 oauth_signature_method=HMAC-SHA1, oauth_timestamp=1277424969,
 oauth_version=1.0, oauth_signature=%2Ff8P1dS6QVQnYCIc10kD1%2Bm2DkI
 %3D

 using

  objhttp.Open POST, https://api.twitter.com/oauth/request_token;,
 False

  objhttp.setRequestHeader Content-type, application/x-www-form-
 urlencoded
  objhttp.setRequestHeader Authorization, strsend
 objhttp.send()

 Not working, how can I see the stream that is being loaded...or debug
 this...
 and strsend is Oauth  and appended by the very first string up on
 top in this email

 Cant see the problem...

 Please help, if you can see anything outright off or wrong...

 Regards,
 Shob




-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


[twitter-dev] request token by string

2009-11-13 Thread Nathan

I am building a WEB application.
I am doing this to send the user to the oauth url:
RequestToken requestToken = twitter.getOAuthRequestToken();
String authorizationUrl = requestToken.getAuthorizationURL();
So then the user leaves my page, and comes back to my callback URL,
with an HTTP parameter called oauth_token.
What do I do from there?
The examples say: accessToken = requestToken.getAccessToken();
But I don't have the requestToken object anymore.

How do I use oauth_token to either recreate that object, or get the
accesstoken
directly, but using the string instead of the object?

I would make a lot of sense that you should be able to new
RequestToken using a string, or something like that.

Thanks
Nathan