gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:43:54 25 4
gpt4 key购买 nike

我们已经开始使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com