oauth_callback for Khan Academy API not woring

耗尽温柔 提交于 2020-01-03 04:47:11

问题


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.

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

The Javascript error I am getting is:

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

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


回答1:


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.

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

Enjoy



来源:https://stackoverflow.com/questions/36089044/oauth-callback-for-khan-academy-api-not-woring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!