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",
method: "GET",
success: function (data) {
var controllerElement = document.querySelector('[ng-controller=YammerFeedCtrl]')
var $scope= angular.element(controllerElement).scope();
$scope.yammerfeed = data
$scope.convertDateStringsToDates($scope.yammerfeed)
$scope.loaded = true
$scope.$apply();
},
error: function (user) {
alert("There was an error with the request.");
}
});
}
var init = function () {
$scope.selectUser($scope.yammerUsers[0])
yam.getLoginStatus(
function(response) {
if (response.authResponse) {
var controllerElement = document.querySelector('[ng-controller=YammerFeedCtrl]')
var $scope= angular.element(controllerElement).scope();
$scope.yammerRequest();
}
else {
yam.platform.login(
function(response){
if (response.authResponse) {
yam.getLoginStatus(
function(response) {
if (response.authResponse) {
yam.platform.request({
url: "messages/in_group/1312007.json?threaded=true",
method: "GET",
success: function (data) {
var controllerElement = document.querySelector('[ng-controller=YammerFeedCtrl]')
var $scope= angular.element(controllerElement).scope();
$scope.yammerfeed = data
$scope.convertDateStringsToDates($scope.yammerfeed)
$scope.loaded = true
$scope.$apply();
},
error: function (data, data1, data2) {
alert(data.statusText);
}
});
}
});
source
share