Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Susan Young
Getting HTTP Headers in Liferay
12 luglio 2012 11.34
Risposta

Susan Young

Punteggio: New Member

Messaggi: 17

Data di Iscrizione: 24 gennaio 2012

Messaggi recenti

Hi Everyone,

I'm trying to troubleshoot a SSO issue and I want to confirm that a certain HTTP header is being received at the Liferay server to trigger auto login for a SiteMinder user.

I'd like to print the HTTP headers to the screen to confirm that SM_user is being sent as an HTTP_header.

I've tried embedding the following Javascript code in a portlet or adding it a page using the Javascript dialog in the portal "Manage Pages" interface (I am using Liferay 5.2.3). Here is the code:

1
2var req = new XMLHttpRequest();
3req.open('GET', document.location, false);
4req.send(null);
5var headers = req.getAllResponseHeaders().toLowerCase();
6alert(headers);


In either case (embedding the code in the portlet in or using the pages interface), the code displays only a portion of the HTTP headers (as far as I can tell). This is the result:

server: apache-coyote/1.1
liferay-portal: liferay portal standard edition 5.2.3 (augustine / build 5203 / may 20, 2009)
content-encoding: gzip
content-type: text/html;charset=utf-8
content-length: 5493
date: thu, 12 jul 2012 18:16:23 gmt

Is there a way to return the entire list of HTTP response headers? I'm wondering if somehow the response is getting "scoped"?

Many thanks,

Susan
Jay Patel
RE: Getting HTTP Headers in Liferay
12 luglio 2012 12.09
Risposta

Jay Patel

Punteggio: Regular Member

Messaggi: 114

Data di Iscrizione: 23 febbraio 2010

Messaggi recenti

Hi Susan,

I am not able to get what exactly you want to achieve, but if you want to get all the headers, you can simply intercept request using hook & print all the HTTP headers.

-Jay.
Mika Koivisto
RE: Getting HTTP Headers in Liferay
12 luglio 2012 13.56
Risposta

Mika Koivisto

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1325

Data di Iscrizione: 7 agosto 2006

Messaggi recenti

Siteminder agent will only send a request header to the server and it won't appear on the server response headers. You need to inspect the request headers on server-side and not on client-side. If I remember correctly tomcat has a request dumper valve to dump request information.