thephpleague / oauth1-client

OAuth 1 Client
MIT License
968 stars 73 forks source link

Last release is broken #139

Closed Diegslapasteque closed 3 years ago

Diegslapasteque commented 3 years ago

Hey, I made a pull request last week about Twitter, but I don't test it because I thought the Twitter docs were clear enough. Sadly, it was not. So now, when we make an oauth connection with Twitter, we get this :

{
    "errors":[{
        "code":32,
        "message":"Could not authenticate you."
    }]
}".

This error is documented here : https://developer.twitter.com/en/support/twitter-api/error-troubleshooting (search for "code 32" in the page). I haven't already find a solution to fix that, but I will made a PR a soon as possible.

Sorry for that.

bitmanid commented 3 years ago

I got same problem. After a few hour debugging and searching in commit history, the problem come from file commit on server at temporaryCredentialsProtocolHeader. It was commit from 10 days ago

https://github.com/thephpleague/oauth1-client/commit/8bf4d9ab61fedf45ccbad975e4cf8391b58b6128#diff-fb33b1b907a4b627dbcc1965898b866ab2be2ac4d4bb611bd47caf39137b5d08

and here is the code:

$parameters = array_merge(
      $this->baseProtocolParameters(),
      $this->additionalTemporaryCredentialsProtocolParameters(),
      [
          'oauth_callback' => $this->clientCredentials->getCallbackUri(),
      ]
  );

i think it need twitter application scope

'scope' => 'your-application-scope' // optional ('read', 'write'), defaults to 'read'

but in my case i'm using the previous code, i haven't try to add application scope.

bencorlett commented 3 years ago

Thank you for the report. I’ll look to revert this as soon as possible.

I might hold off introducing this until V2 which is basically ready. It facilitates testing in a way that V1 just simply doesn’t support.

Sent from my iPhone

On 12 Aug 2021, at 2:00 pm, bitman @.***> wrote:

 I got same problem. After a few hour debugging and searching in commit history, the problem come from file commit on server at temporaryCredentialsProtocolHeader. It was commit from 10 days ago

8bf4d9a#diff-fb33b1b907a4b627dbcc1965898b866ab2be2ac4d4bb611bd47caf39137b5d08

and here is the code:

$parameters = array_merge( $this->baseProtocolParameters(), $this->additionalTemporaryCredentialsProtocolParameters(), [ 'oauth_callback' => $this->clientCredentials->getCallbackUri(), ] ); i think it need twitter application scope

'scope' => 'your-application-scope' // optional ('read', 'write'), defaults to 'read'

but in my case i'm using the previous code, i haven't try to add application scope.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.