IN.User.Authorize回调从未触发 [英] IN.User.Authorize callback never fired
问题描述
从今天开始,我们使用linkedin Javascript SDK进行用户身份验证的应用程序停止工作. 我们意识到现在对 https://platform.linkedin.com/in.js 的调用重定向到 https://platform.linkedin.com/xdoor/scripts/in.js .
Since today, our application that uses the linkedin javascript SDK to authenticate users stopped working. We realized that the call to https://platform.linkedin.com/in.js now redirects to https://platform.linkedin.com/xdoor/scripts/in.js.
因此,对IN.User.Authorize(callbackFunction)
的调用成功打开了身份验证对话框窗口,但不再触发该回调.
Consequently, calls to IN.User.Authorize(callbackFunction)
successfully opens the authentication dialog window but the callback is never fired anymore.
此外,在应用程序的另一部分中,我们使用IN.UI.Authorize.place().onWindowRemove.subscribe(callbackFunction)
跟踪对话框关闭.此功能还停止了措词,现在使用URL invalid://
打开一个新窗口,控制台将引发以下错误:
Also, in another part of our application we are using the IN.UI.Authorize.place().onWindowRemove.subscribe(callbackFunction)
to track dialog closes. This feature has also stopped wording and now opens a new window with the url invalid://
and the console throws this error:
jSecure Error: URL should be absolute with allowed schemas, relative, a hash fragment or query string. TODO?client_id=XXXX&type=user-agent in.js:7
jSecure Error: URL should be absolute with allowed schemas, relative, a hash fragment or query string. invalid://?xdOrigin=https%3A%2F%2FXXX-XXX&xdChannel=XXXX&xd_origin_host=https%3A%2F%2FXXXX.XXXX in.js:7
jSecure Error: URL should be absolute with allowed schemas, relative, a hash fragment or query string. TODO?client_id=XXXX&type=user-agent
您对为什么它停止工作有想法吗?
Do you have an idea on why this stopped working ?
错误于2019年1月28日重新出现.
Bug reappeared as of 2019 01 28.
推荐答案
尝试将window.IN.User.authorize替换为window.IN.user.authorize
Try replacing window.IN.User.authorize with window.IN.user.authorize
window.IN.user.authorize 返回一个Promise,并在登录成功后执行成功回调.如果我们将User替换为user
window.IN.user.authorize is returning a promise and success callback is executed post login success. Its weird but working if we replace User with user
window.IN.user.authorize().then(function(data){
console.log("Logged in successfully .");
window.IN.API.Raw("/people/~:(id,first-name,last-name,formatted-name,headline,location,industry,current-share,num-connections,num-connections-capped,summary,specialties,positions,picture-url,site-standard-profile-request,api-standard-profile-request,public-profile-url,email-address)").method("GET").body().result(function (oData) {
that.props.dispatch(userCreation(linkedInProfileFormat(oData)));
});
},function(error){
alert("Linkedin failed because of harshita !");
});
这篇关于IN.User.Authorize回调从未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!