thephpleague / oauth1-client

OAuth 1 Client
MIT License
968 stars 73 forks source link

Twitter could not authenticate temporary credentials #100

Closed alvirbismonte closed 4 years ago

alvirbismonte commented 4 years ago

I've used the twitter example in the repo and getting this error. The error also comes from this line.

I am able to get temporary credentials and able to get oauth token, but when I do use the returned token to fetch user details, I'm unable to fetch it thus the error.

League\OAuth1\Client\Credentials\CredentialsException: Received HTTP status code [401] with message "{"errors":[{"code":32,"message":"Could not authenticate you."}]}" when getting temporary credentials. in /vendor/league/oauth1-client/src/Client/Server/Server.php:418

I read an issue like this and they are referring to setting isSecure: false but I'm unable to find this in the package. Could you please help me. Thanks

alvirbismonte commented 4 years ago

It turns out that I did not followed the 3-legged Oauth by twitter which is also indicated in the sample from the library.

pushparajbhatta commented 2 years ago

I had been getting the same error at the redirection controller while using oauth 1

Received HTTP status code [401] with message "{"errors":[{"code":32,"message":"Could not authenticate you."}]}" when getting temporary credentials.

I found out that I had been using oauth 2 client id and client secret on my configuration. Please make sure you are using the credentials (API Key and Secret) from "Consumer Keys" on twitter app settings. The API Key and Secret under "Consumer Keys" are client id and client secret respectively for oauth 1.