Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth problems #183

Open
FooleanBool opened this issue Jun 11, 2015 · 3 comments
Open

Auth problems #183

FooleanBool opened this issue Jun 11, 2015 · 3 comments
Assignees
Labels

Comments

@FooleanBool
Copy link

Hi Matt.
First off thanks for sharing this OAuth implementation and secondly thanks for replying to my twitter message.
I have installed and configured your web examples with my twitter app keys.
When running the 'verify credentials' part, I get a successful response and the latest tweet is shown.
When running the 'auth flow; part, I also get a successful response and am invited to authorise the app with a twitter based authorise button, and am successfully redirected back to the calling page.
However, when trying to search for any keyword:
HTTP/1.1 400 Bad Request
{"errors":[{"code":215,"message":"Bad Authentication data."}]}


When I try to use the photo_tweet part I receive:
HTTP/1.1 100 Continue
HTTP/1.1 403 Forbidden
{"errors":[{"code":189,"message":"Error creating status."}]}
My app is set to read/write permissions, and when using the twitter OAuth signing results curl command form my terminal (GET /1.1/search/tweets.json?q=egg HTTP/1.1) I do get a valid response.
The only thing missing from the config array is the 'bearer' which is left blank (''), simply because I have no idea what to put there. I get the same behaviour running from localhost dev machine and from my online web host.
Have you any idea what I have missed?
I apologise if I am being an idiot and doing something wrong, but I've read through the instructions more than once and can't find anything amiss.
I appreciate your help with this,
Paul.

@eXorus
Copy link

eXorus commented Jul 22, 2015

Same for me it was working well a few months ago.

@themattharris
Copy link
Owner

hey guys,
bad authentication data comes back from twitter when the oauth token or secret are missing or invalid. can you update your scripts to output $this->config['user_token'] and $this->config['user_secret'] - just to make sure they are there.

user_requests (those that use the results of the auth flow and user_token and user_secret should be invoked with $tmhOAuth->user_request.

the bearer that you are referring to is for application only auth (https://dev.twitter.com/oauth/application-only) and is invoked using $tmhOAuth->apponly_request. a blank bearer here will cause bad authentication data.

for the 403 you are getting when creating a status. there are many reasons for a 403 to come back from twitter. inspect the contents of $tmhOAuth->response['response'] to see the error message twitter responded with.

@eXorus
Copy link

eXorus commented Jul 22, 2015

I have the error message :
[code] => 403 [response] => {"errors":[{"code":189,"message":"Error creating status."}

when I post to
https://api.twitter.com/1.1/statuses/update_with_media.json

I used consumer_key, consumer_secret, token and secret
The bearer is empty but the user_token and secret are used.

I never used $tmhOAuth->apponly_request and it was working before so ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants