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 am working on building an oauth flow with PassportJS for Twitter. I am looking to use the 'write' permissions to follow a user through the oauth'd Twitter account upon oauth authentication. Only issue is it's only giving me read permissions. I've setup the Read/Write permission settings in the Twitter app dashboard and modified the requestTokenURL in the strategy parameters yet the page that says what permissions the server is requesting isn't showing any write permissions just read.
constexpress=require('express');constpassport=require('passport');constStrategy=require('passport-twitter').Strategy;passport.use(newStrategy({consumerKey: 'XXX',consumerSecret: 'XXX',requestTokenURL: 'https://api.twitter.com/oauth/request_token?x_auth_access_type=write',callbackURL: 'XXX/oauth/callback'},(token,tokenSecret,profile,cb)=>{console.log(profile,token,tokenSecret);returncb(null,profile);}));passport.serializeUser((user,cb)=>{cb(null,user);});passport.deserializeUser((obj,cb)=>{cb(null,obj);});letapp=express();app.use(require('express-session')({secret: 'keyboard cat',resave: true,saveUninitialized: true}));app.use(passport.initialize());app.use(passport.session());app.get('/',(req,res)=>{res.send('<html><body><center><a href="/oauth/twitter">Login with Twitter</a></center></body></html>');});app.get('/oauth/twitter',passport.authenticate('twitter'));app.get('/oauth/callback',passport.authenticate('twitter',{failureRedirect: '/'}),(req,res)=>{res.send('<html><body><center><h3>You are now following the account and have notifications on!</h3></center></body></html>');});app.listen(3000,'0.0.0.0',(err)=>{if(err)throwerr;console.log('Server is now running');});
The text was updated successfully, but these errors were encountered:
jacob-cross99
changed the title
Passport-Twitter Write Acess not working
Write Acess not working
Mar 29, 2017
I am working on building an oauth flow with PassportJS for Twitter. I am looking to use the 'write' permissions to follow a user through the oauth'd Twitter account upon oauth authentication. Only issue is it's only giving me read permissions. I've setup the Read/Write permission settings in the Twitter app dashboard and modified the requestTokenURL in the strategy parameters yet the page that says what permissions the server is requesting isn't showing any write permissions just read.
The text was updated successfully, but these errors were encountered: