nraboy / ng-cordova-oauth

AngularJS oauth library for use with Apache Cordova projects
https://www.thepolyglotdeveloper.com
MIT License
456 stars 199 forks source link

Twitter have change method for creating signatures #295

Closed krunalm1992 closed 7 years ago

krunalm1992 commented 7 years ago

I'm trying to read user timeline using $cordovaOauthUtility but it always give me error "Could not authenticate you". When I seen further in code and compare it's signature generation method so I found that code only using OAuth token secret as Signing key but according to twitter " Both Consumer secret and OAuth token secret values need to be combined to form a signing key which will be used to generate the signature. "

For example Consumer secret kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw OAuth token secret LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE

Then, Signing key kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw&LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE

nraboy commented 7 years ago

Do you get an access token from this library? If yes, then it has done what it needs to do and as a result you'd have to consult the Twitter forums or Stack Overflow for help on how to use their APIs with the access token.

If you're not receiving an access token, this is a different scenario.

Best,

krunalm1992 commented 7 years ago

Hay I got access token using this library and I also have check twitter api.. But as per twitter we need to generate signing key to authenticate user and as this library also include $cordovaOauthUtility service which use to generate authentication header used in twitter api.. I have tried to use the same but it doesn't work.. After looking in to code I have found that it $cordovaOauthUtility service only use consumer secret as signing key to generate the signature but as per twitter there should be combination of Consumer secret and OAuth token secret..

nraboy commented 7 years ago

You might want to read this:

https://devdactic.com/twitter-rest-api-angularjs/

The issue tracker is for bug tickets and feature requests only. You'll have to take your questions and concerns about how to properly use the provider APIs to Stack Overflow or elsewhere. Like I said, if you're receiving an access token, this library has done its job.

Best,