Instagram的API:身份验证过程中力提示 [英] Instagram API: force prompt during authentication
本文介绍了Instagram的API:身份验证过程中力提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有任何对Instagram的身份验证方式(登录),始终进行身份验证问?当用户登录,并已授权应用程序这是跳过。
Is there a way for the instagram auth(login) to always ask for authentication? This is skipped when the user is logged in and has already authorized the app.
这将是类似Twitter的 use_authorize = TRUE
或谷歌的 approval_prompt =力
。
It would be something like twitter's use_authorize=true
or google's approval_prompt=force
.
推荐答案
我设法得到它的工作:
我尝试打开弹出授权前装载与Instagram的注销页面的URL的图像。结果
像这样的东西(的CoffeeScript):
I try loading an image with the url of the instagram logout page before opening the authorize popup.
Something like this (coffeescript):
windowOpen = ->
window.open("/instagram/authorize?...")
if forceLogin
tryLogout().always ->
windowOpen()
而tryLogout功能(setTimeout的10秒作为备用)
And the tryLogout function (setTimeout 10seconds as a fallback)
tryLogout: ->
deferred = $.Deferred()
logOutImg = new Image()
logOutImg.onerror = ->
deferred.resolve()
logOutImg.onload = ->
deferred.resolve()
logOutImg.src = 'https://instagram.com/accounts/logout/'
setTimeout(->
deferred.reject()
, 10000)
return deferred.promise()
这篇关于Instagram的API:身份验证过程中力提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文