OAuth(Instagram)没有刷新 [英] OAuth (Instagram) without refresh
问题描述
我有一个单一的JavaScript应用程序,我想知道我是否可以在Instagram上验证用户,而不刷新页面。我想尝试做一些类似于Facebook连接使用javascript,其中一个Facebook对话框打开一个弹出窗口,然后调用回调脚本后。
I have a single page javascript application, and I'm wondering if I can authenticate the user on Instagram without refreshing the page. I'd like to try to do something similar to the Facebook connect using javascript, where a Facebook dialog opens in a popup then calls a callback script after.
这里是我的
- 点击后,打开一个对话框(弹出窗口),用户登录到Instagram和
- 在弹出式窗口中,用户被重定向回我的网站,我的网站卷曲到Instagram以获取access_token,然后在用户的会话中设置访问令牌
- 无论如何...主应用程序需要识别何时设置访问令牌。这是我真的不知道的点。我会使用一个计时器继续调用回服务器来检查它吗?有没有人有任何更好的想法来检测它?
$ b $ p
我想我会在开始编码之前先问这个问题,想法,如果这将/不会工作,或其他建议!
I thought I'd ask here first before I start coding incase anyone had any ideas as to if this would/wouldn't work, or other suggestions! Maybe this already exists and I'm missing something?
提前感谢: - )
推荐答案
它最终是超级容易做到这一点弹出使用tdun和Jan的意见。从9lessons使用Instgram类,并使用window.opener.processAuthData(authData)回调到原来的窗口。我确实有刷新,但它是在弹出窗口,而不是在主要的应用程序窗口,这是我要去。
It ended up being super easy to do this with a popup using the comments from tdun and Jan. Thanks guys! Used the Instgram class from 9lessons, and used window.opener.processAuthData(authData) to call back to the original window. And I did have to do a refresh, but it was in the popup window, not in the main app window, which was what I was going for.
这篇关于OAuth(Instagram)没有刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!