Yammer JSON SDK authenticates through ADFS in Chrome and FF, but Access Denied in IE

We started testing JSON APi using the JavaScript SDK. We have ADFS installed for authentication in IE, and if you open a browser window and go to our network on Yammer, everything will work just like embedding a Yammer feed using Embed code.

However, we have a problem with the JSON channel - with all browsers, but with IE we will receive an invitation to log in if it is not already logged in, and then it will bring us to us, and we will see the feed, however in IE we will get Access Denied pop-up message.

We added assets.yammer.com/assets/platform_js_sdk.js to ADFS as a recognized source.

Has anyone else had a problem with Just IE and ADFS authentication?

Thanks in advance! Rich

We took the code from the Yammer API link and use it as follows:

$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);
        }
    });
    }
    });
+4
source share
2 answers

Oops - I forgot to post the answer - update2 has information about the solution - you just need to have everything in the same security zone.

0
source

I hit my head about this problem for several days, and you will lose your mind when you see how easy it is to solve it. You should:

  • Open Internet Explorer
  • Press the Alt key to open the toolbar
  • Select "Tools"
  • Select Internet Options
  • Select the Security tab
  • Select Trusted Sites, then click the Sites button.
  • Add www.yammer.com to the zone

. , .

0

All Articles