I am new to using Auth0 and am having some problems with the scopes that the apps provide once you log in to any social app. In my case with Twitter, I have been trying to post on behalf of the users, and doing this is really challenging, at least for me.
I have everything set up to make this happen. The X developer account, with a project set up, has project scopes open to Twitter API 2.0, and auth0 is set up with login.
// app/api/auth/[auth0]/route.js
import { handleAuth } from '@auth0/nextjs-auth0';
export const GET = handleAuth();
This will result in the session of the user:
Session {
user: {
nickname: 'Bongo',
name: 'Bongo',
picture: 'https://pbs.twimg.com/profile_images/1847066378303385600/LdbP8B_K_normal.jpg',
updated_at: '2024-10-22T19:59:50.007Z',
sub: 'twitter|1023501740',
sid: 'sid'
},
accessToken: 'accessToken',
accessTokenScope: 'openid profile email',
accessTokenExpiresAt: 1729713590,
idToken: 'idToken',
token_type: 'Bearer'
}
I can log users with email and password, Facebook, Google, and Twitter correctly and they display as normal. The problem is when I see the accessTokenScope of the session being “openid profile email”. This doesn’t give me the access I need.
What should I do to ask the user to give permission to my app? I am really lost here, thanks everyone.