Skip to content

Access Token must be provided for OAuth1.0a User Context #2151

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

You must be logged in to vote

Here. I'll share the entire repo with you.

No need. Sorry, I just realized the error is occurring in callback, not get_user_tweets.
In callback, you're passing the entire response (which you're assigning to access_token) to Client, not just the access token:

    access_token = auth.fetch_token(request.url)

    print(f"Access token: {access_token}")
    session["access_token"] = access_token
    refresh_token = access_token["refresh_token"]

    ...

    client = tweepy.Client(access_token)
    me = client.get_me(user_auth=False)

I probably missed this because this wasn't in your initial example code.

which you should really clarify which access token you're talking about in the docs b…

Replies: 11 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Harmon758
Comment options

You must be logged in to vote
1 reply
@yiyiyi0817
Comment options

Comment options

You must be logged in to vote
8 replies
@ZachHandley
Comment options

@Harmon758
Comment options

@ZachHandley
Comment options

@ZachHandley
Comment options

@Harmon758
Comment options

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
3 participants
Converted from issue

This discussion was converted from issue #2150 on August 03, 2023 04:36.