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

  1. you can make request logout end point if instagram supports it. once logout can login again
  2. i not sure if instagram supports prompt=login parameter. if should take login page each call.
  3. i checked instagram documentation , think can use client side (implicit) flow login every time access token.

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -