node.js - How do I make Instagram OAuth (or any OAuth) always force the user to sign in, even if they are signed into the application's website? -
i'm building tool user want authenticate multiple instagram accounts application. problem run if user has authenticated 1 , initiate oauth dialogue again, oauth assumes want access token of user logged in.
i have ios app similar , way avoid clear cookies of safari browser.
i'm using instagram-node
module right now.
app.get('/authenticateinstagram', function(req, res) { res.redirect(ig.get_authorization_url(redirecturi, { scope: ['basic', 'public_content', 'likes', 'follower_list', 'relationships'], state: 'a state' })); }); app.get('/handleinstagramauth', function(req, res) { ig.authorize_user(req.query.code, redirecturi, function(err, result) { if (err) { console.log(err.body); res.send('didn\'t work'); } else { console.log('yay! access token ' + result.access_token); res.send('you made it!!'); } }); });
so when try add ig account (now i've signed instagram account already), don't prompted log in oauth sequence. assumes i'm signed in user.
i can think of following approaches
- you can make request logout end point if instagram supports it. once logout can login again
- i not sure if instagram supports
prompt=login
parameter. if should take login page each call. - i checked instagram documentation , think can use client side (implicit) flow login every time access token.
Comments
Post a Comment