可汗学院API的oauth_callback不满意 [英] oauth_callback for Khan Academy API not woring

查看:99
本文介绍了可汗学院API的oauth_callback不满意的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在与Khan Academy进行应用程序连接,在授权请求令牌后,我无法获得适当的重定向.我总是会收到默认的回调以及正文"OK",并且永远不会重定向回我们在oauth-callback上指定的位置.

We are working on wiring up our application with Khan Academy and I am not able to get a proper redirect back after authorizing the request token. I always get the default callback along with the body "OK" and NEVER get redirected back to the location specified on our oauth-callback.

我在浏览器中收到一个javascript错误,我想知道这是否是问题的根源.这是我们的授权调用的示例(成功获取请求令牌后):

I am getting a javascript error in the browser and I am wondering if this is the source of the problem. Here is an example of our authorize call (after successfully getting the request token):

https://www.khanacademy.org/api/auth2/authorize?oauth_callback=http%3A%2F%2Fdev.kudoso.com%2Fauth%2Fkhan_academy%2Fcallback&member_id=2&oauth_token=t0000003404618819

我遇到的Javascript错误是:

The Javascript error I am getting is:

/genfiles/javascript/en/shared-package-8caf31.js:94 Uncaught TypeError: KA.staticUrl is not a function

我在Firefox和Chrome中都遇到此错误.任何帮助,将不胜感激.谢谢!

I am getting this error in both Firefox and Chrome. Any help would be appreciated. Thanks!

推荐答案

经过许多月,我们终于弄清楚了到底发生了什么. Khan Academy的API中存在一个错误,该错误不支持在标头中包含oauth_callback的oauth标准,但允许您将其作为参数提交.

After many, many months, we finally figured out what is going on. Khan Academy has a bug in their API where they do not support the oauth standard of including the oauth_callback in the header, but does allow you to submit it as a param.

我们在此处实施了红宝石修复程序: https://github.com/DaKaZ/omniauth-khan -学院

We implemented a ruby fix here: https://github.com/DaKaZ/omniauth-khan-academy

享受

这篇关于可汗学院API的oauth_callback不满意的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆