You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm able to get an oauth access token + secret from the user that authorizes the connection via app.
My intention was to use the oauth access token to make requests via the node-twitter-api-v2 library, for example - fetching the user's bookmarks.
I tried using the access token in place of the "bearer token" when initializing the TwitterApi client, but am still getting the error:
Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context].
From my understanding, such requests must be made via a "logged in" client and the v2 api - question is, is there a way to use the already authed user's (via app) token to make the request / log in? This is done via background + backend, so the idea is that there is no UI / callback to make the user go through to create the logged in session.
Any ideas on how to approach this or if it's even possible?
Example code:
//call the new v2 api
const bookmarkedTweets = await this.twitterClient.v2.bookmarks({
max_results: max_fetch_limit,
expansions: ['attachments.media_keys'],
'media.fields': ['preview_image_url', 'url', 'variants'],
'tweet.fields': ['created_at', 'entities', 'attachments', 'author_id', 'conversation_id', 'id', 'text'],
});
Error response:
data: {
> title: 'Unsupported Authentication',
> detail: 'Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context].',
> type: 'https://api.twitter.com/2/problems/unsupported-authentication',
> status: 403
> }
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, i've succesfully integrated Twitter Auth via my iOS app and firebase, as explained here: https://firebase.google.com/docs/auth/ios/twitter-login
I'm able to get an oauth access token + secret from the user that authorizes the connection via app.
My intention was to use the oauth access token to make requests via the node-twitter-api-v2 library, for example - fetching the user's bookmarks.
I tried using the access token in place of the "bearer token" when initializing the TwitterApi client, but am still getting the error:
Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context].
From my understanding, such requests must be made via a "logged in" client and the v2 api - question is, is there a way to use the already authed user's (via app) token to make the request / log in? This is done via background + backend, so the idea is that there is no UI / callback to make the user go through to create the logged in session.
Any ideas on how to approach this or if it's even possible?
Example code:
Error response:
Thank you - any help is greatly appreciated ❤️
Beta Was this translation helpful? Give feedback.
All reactions