javascript - Yammer JSON SDK 在 Chrome 和 FF 中通过 ADFS 进行身份验证,但在 IE 中访问被拒绝

标签 javascript json sdk adfs yammer

我们已经开始使用 JavaScript SDK 测试 JSON API。我们将 ADFS 设置为在 IE 中进行身份验证,如果您打开浏览器窗口并在 Yammer 上访问我们的网络,这一切都可以正常工作,就像使用嵌入代码嵌入 Yammer 提要一样。

然而,我们遇到了 JSON 提要的问题 - 对于除 IE 之外的所有浏览器,如果尚未登录,我们将收到登录提示,然后这将引导我们完成并看到提要,但是在 IE 中我们获取拒绝访问的弹出窗口。

我们已将 assets.yammer.com/assets/platform_js_sdk.js 作为公认的来源添加到 ADFS 中

有没有其他人对 Just IE 和通过 ADFS 的身份验证有疑问?

提前致谢! 丰富

我们已从 Yammer API 引用中获取代码并按如下方式使用它:

$scope.yammerRequest = function(){
    yam.platform.request({
        url: "messages/in_group/1312007.json?threaded=true",
        //url: "messages.json?threaded=true",
        //url: "messages.json?threaded=true",     //this is one of many REST endpoints that are available
        method: "GET",
        success: function (data) { 
            //Angulars $scope getting lost when inside an external library
            // so we need to find the controller, which we can use to get the $scope
            //get the controller
            var controllerElement = document.querySelector('[ng-controller=YammerFeedCtrl]')
            //use angularjs to get the scope from the controller
            var $scope= angular.element(controllerElement).scope();
            //get the messages from the data
            $scope.yammerfeed = data
            $scope.convertDateStringsToDates($scope.yammerfeed)
                            $scope.loaded = true
            //make sure we apply the changes so they are reflected to the GUI
            $scope.$apply();

        },
        error: function (user) {
            alert("There was an error with the request.");
        }
    });
}
var init = function () {
$scope.selectUser($scope.yammerUsers[0])
    //all Javascript interaction need to be done via thier SDK
    //login to yammer
    //yam.platform.login()
    //yam.connect.loginButton('#yammer-login', function (resp) { if (resp.authResponse) { document.getElementById('yammer-login').innerHTML = 'Welcome to Yammer!'; } }); 
    // url: https://www.yammer.com/oauth2/access_token.json?client_id=[:client_id]&client_secret=[:client_secret]&code=[:code]

    //check login status
    yam.getLoginStatus(
        function(response) {
            if (response.authResponse) {  //if logged in
                //request massages from yammer
                var controllerElement = document.querySelector('[ng-controller=YammerFeedCtrl]')
                //use angularjs to get the scope from the controller
                var $scope= angular.element(controllerElement).scope();
                $scope.yammerRequest();
            }
            else {
                //alert("not logged in")
                //all Javascript interaction need to be done via thier SDK
                //login to yammer
                yam.platform.login(
                    function(response){
                        if (response.authResponse) {
                            //var controllerElement = document.querySelector('[ng-controller=YammerFeedCtrl]')
                            ////use angularjs to get the scope from the controller
                            //var $scope= angular.element(controllerElement).scope();
                            //$scope.yammerRequest();
                            yam.getLoginStatus(
        function(response) {
            if (response.authResponse) {
                            yam.platform.request({
        //url: "messages.json?threaded=true",
        url: "messages/in_group/1312007.json?threaded=true",
        //url: "messages.json?threaded=true",     //this is one of many REST endpoints that are available
        method: "GET",
        success: function (data) { 
            //Angulars $scope getting lost when inside an external library
            // so we need to find the controller, which we can use to get the $scope
            //get the controller
            var controllerElement = document.querySelector('[ng-controller=YammerFeedCtrl]')
            //use angularjs to get the scope from the controller
            var $scope= angular.element(controllerElement).scope();
            //get the messages from the data
            $scope.yammerfeed = data
            $scope.convertDateStringsToDates($scope.yammerfeed)
                $scope.loaded = true            
            //make sure we apply the changes so they are reflected to the GUI
            $scope.$apply();

        },
        error: function (data, data1, data2) {
            alert(data.statusText);
        }
    });
    }
    });

最佳答案

糟糕 - 忘记发布答案 - update2 有关于解决方案的信息 - 只需要将所有内容都放在同一个安全区域中即可。

关于javascript - Yammer JSON SDK 在 Chrome 和 FF 中通过 ADFS 进行身份验证,但在 IE 中访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25353509/

相关文章:

Python,在解析 JSON 对象时正确处理关键错误

android - 尝试为 Android 应用程序导出签名包时出现错误 "setTestClassesDir(File) method has been deprecated"

javascript - 三 JS 网格在模型的另一侧可见

javascript - 如何在每次动画迭代计数后更改元素的大小?

javascript - 附加带有固定行名称的文件 javascript

ajax - Google Chrome 将 JSON AJAX 响应显示为树而不是纯文本

javascript - 查询嵌套对象键

java - Android、Google map API、JSON 问题。获取空指针异常

ios - Apple 是否规定 iOS 应用程序必须使用哪个 SDK 版本?

c# - Skype for Business 2016 没有客户端 SDK