Question

I have added 3rd party widgets to IBM Connections (both 4.0 and 4.5) in homepage and communities and they cause the page to go into a redirect loop after the widgets finish loading.

I have tried many different security and widget settings without being able to remove this behaviour.

Symptoms - When a third party widget loads on the page, the page goes into a redirect loop. - In Homepage - it gets a 302 redirect to "GET /homepage/web/authredirect.action HTTP/1.1" - In Communities - it gets a 302 redirect to "GET /communities/service/html/login HTTP/1.1"

In both cases the page it is redirected to finds that you are actually authenticated and you are redirected back to the original page.

Has anyone experienced anything like this before and knows how to fix it?

Was it helpful?

Solution

I have seen this happen when the iWidget uses Dojo to perform a request with handleAs="json". Instead, use handleAs="text", and then use dojo.fromJson(dataStr) to parse the string into a json object.

For example, the following caused a reload issue for me:

var xhrArgs =
{
    url:'/MyServlet',
    content:{Id:this.userId},
    handleAs:"json",
    load:dojo.hitch(this,function(jsonObj){
        console.log("json",jsonObj);
    }),
    contentType: "application/x-www-form-urlencoded; charset=utf-8"
};
dojo.xhrGet(xhrArgs);

Changing the handleAs to 'text' with a dojo.fromJson() call solved the problem:

var xhrArgs =
{       
    url:'/MyServlet',
    content:{Id:this.userId},
    handleAs:"text",
    load:dojo.hitch(this,function(data){
        var jsonObj = dojo.fromJson(data);
        console.log("json",jsonObj);
    }),
    contentType: "application/x-www-form-urlencoded; charset=utf-8"
};
dojo.xhrGet(xhrArgs);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top