问题
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