Skip to content

TypeError: Consumer key must be string or bytes, not NoneType #1974

Closed Answered by Harmon758
kovan asked this question in Questions
Discussion options

You must be logged in to vote

Client.create_tweet uses OAuth 1.0a User Context by default. The error occurs because you don't provide a consumer key, consumer secret, access token, or access token secret, and without those credentials, the method can't use OAuth 1.0 User Context.

If you're using a OAuth 2.0 Authorization Code Flow with PKCE access token, you can set the user_auth parameter to False, to use the access token to authenticate instead.

Otherwise, an app-only bearer token by definition is app-only and doesn't have user context, so it can't be used to perform actions on the behalf of a user, such as creating a Tweet.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Harmon758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question This is a question Discussion This was converted/moved from/to a discussion
2 participants
Converted from issue

This discussion was converted from issue #1972 on October 03, 2022 20:17.