[twitter-dev] Twitter Oauth Realization within an SAP CRM system

2010-09-27 Thread Andyiz
Hello Dev,
-   We are creating Twitter demo from a SAP CRM system.
-   With basic authentication everything worked fine.
-   Now we tried to create an own OAuth client for Twitter with SAP’s
programming language ABAP.
-   We have registered the following (browser) application:
http://dev.twitter.com/apps/232392
-   Our Twitter user is PC4U.
-   We could use our OAuth client implementation to
  a) get access token and secret using the Out-of-
band/PIN Code Authentication (oob) process.
  b) authenticate a simple GET request like
http://api.twitter.com/1/statuses/user_timeline.xml.
-   But when we want to post a message “test” with API
http://api.twitter.com/1/statuses/update.xml, it
does not work


The request is as follows:
POST:
Content type: application/x-www-form-urlencoded
Request body:
status=test

Authorization Header:
OAuth oauth_consumer_key=kpjEiXXXWJnObvdXXXA,oauth_token=1521-
L9XXJRAXXXrmcEKZ2JOpLJesteIXXXWtV2LDXXXZD,oauth_timestamp=1285505230,oauth_nonce=2C8ED6FE5D91C4C4AC62CA89269D6DC1,oauth_version=1.0,oauth_signature_method=HMAC-
SHA1,oauth_signature=Mh1XX%2Bd4F4XXXAjL3zAb7k4XXXE%3D

where…
Base string:
POSThttp%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses
%2Fupdate.xmloauth_consumer_key%3jEiLXXXJnObvXXXpA%26oauth_nonce
%3D2C8ED6FE5DC4AC62CA89269XXX1%26oauth_signature_method%3DHMAC-
SHA1%26oauth_timestamp%3D1285505230%26oauth_token%3D15258921-
L9GT0HrmcEKZ2JOpLJesteIVipWt7BmZD%26oauth_version
%3D1.0%26status%3Dtest

Key:
3t44BXXwwBc7ghXXXh2wu8bqgtpcrf8igYYYDCsof0IhI8cakKsrXXXCMMJ0lOj7LQ8vkSXmBtKKKaXdw

Resulting signature: MhXXd+d4F4ADuAjLXXAb7k4XXXE=

Can you please help us fixing this ?

Please note that the keys has been masked for security purpose.


Regards,
Anand

-- 
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


Re: [twitter-dev] Twitter Oauth Realization within an SAP CRM system

2010-09-27 Thread Tom van der Woerdt
Hi,

The Base String looks fine, so does the Authorization header and the
signature.

What is the error you get back? Not just the error number (probably
401), but also the message.

Tom


On Mon, 27 Sep 2010 02:34:06 -0700 (PDT), Andyiz
mailanand@gmail.com wrote:
 Hello Dev,
 - We are creating Twitter demo from a SAP CRM system.
 - With basic authentication everything worked fine.
 - Now we tried to create an own OAuth client for Twitter with SAP’s
 programming language ABAP.
 - We have registered the following (browser) application:
 http://dev.twitter.com/apps/232392
 - Our Twitter user is PC4U.
 - We could use our OAuth client implementation to
   a) get access token and secret using the Out-of-
 band/PIN Code Authentication (oob) process.
 b) authenticate a simple GET request like
 http://api.twitter.com/1/statuses/user_timeline.xml.
 -   But when we want to post a message “test” with API
 http://api.twitter.com/1/statuses/update.xml, it
 does not work
 
 
 The request is as follows:
 POST:
 Content type: application/x-www-form-urlencoded
 Request body:
 status=test
 
 Authorization Header:
 OAuth oauth_consumer_key=kpjEiXXXWJnObvdXXXA,oauth_token=1521-
 L9XXJRAXXXrmcEKZ2JOpLJesteIXXXWtV2LDXXXZD,oauth_timestamp=1285505230,oauth_nonce=2C8ED6FE5D91C4C4AC62CA89269D6DC1,oauth_version=1.0,oauth_signature_method=HMAC-
 SHA1,oauth_signature=Mh1XX%2Bd4F4XXXAjL3zAb7k4XXXE%3D
 
 where…
 Base string:
 POSThttp%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses
 %2Fupdate.xmloauth_consumer_key%3jEiLXXXJnObvXXXpA%26oauth_nonce
 %3D2C8ED6FE5DC4AC62CA89269XXX1%26oauth_signature_method%3DHMAC-
 SHA1%26oauth_timestamp%3D1285505230%26oauth_token%3D15258921-
 L9GT0HrmcEKZ2JOpLJesteIVipWt7BmZD%26oauth_version
 %3D1.0%26status%3Dtest
 
 Key:
 3t44BXXwwBc7ghXXXh2wu8bqgtpcrf8igYYYDCsof0IhI8cakKsrXXXCMMJ0lOj7LQ8vkSXmBtKKKaXdw
 
 Resulting signature: MhXXd+d4F4ADuAjLXXAb7k4XXXE=
 
 Can you please help us fixing this ?
 
 Please note that the keys has been masked for security purpose.
 
 
 Regards,
 Anand

-- 
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