切换用户或再使用Instagram的认证 [英] Switch user or re authenticate with Instagram
问题描述
继 Instagram的文档我能够轻松地验证用户和检索access_token
Following the Instagram documentation I'm able to authenticate a user and retrieve an access_token easily
但现在我想改变这是不可能的,因为浏览器会自动调用我的回调URL,因为我已经签署的账户的Instagram账号(没有登录/授权形式再次)
But now I want to change of Instagram account which is impossible since the browser automatically call my callback URL because I'm already signed in with an account (there is no login / authorization form again)
要解释什么是发生在这里的身份验证/授权流程:
To explain what happen here is the authenticate / authorization flow :
- 打开一个浏览器,要求用户登录和授权
- 在用户填写表单并提交(当用户已登录则跳过此步骤!)
- 在浏览器重定向到回调URL
您看到第2步将被跳过,所以我们不能用其他用户登录
You see step 2 is skipped so we can't login with another user
是否Instagram的有一个参数强制重新登录?
Does the Instagram have a parameter to force relogin ?
推荐答案
贾斯汀·鲍威尔的回答是工作日志了,但我需要还能够刚过登录 这是相当是烦人Android版
Justin Powell answer is working for log out but I need to be also able to log in just after and it's quite anoying for Android
但它指向我朝着正确的方向:Instagram的(像其他网站)维护我们的登录与会话变量(所以用饼干)
But it points me in the right direction : Instagram (like other website) maintains our login with session variable (so with cookies)
因此,为了避免被永远loged中,我们只需要找到并删除正确的cookie,这里是如何与Android做到这一点:
So to avoid to be always loged in, we just have to find and remove the correct cookie, here is how to do it with Android :
String cookieString = "sessionid=''";
CookieManager.getInstance().setCookie("instagram.com", cookieString);
有了这个,我设置的Instagram 的SessionID
cookie来连接空字符串,这样的Instagram不认我了
With this I set the Instagram sessionid
cookie to en empty string so Instagram doesn't recognize me anymore
这篇关于切换用户或再使用Instagram的认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!