This is a discussion on How to pass custom header information in Redirect (Using C Module). within the Windows Web Servers forums, part of the Web Server and Related Forums category; We have a custom Apche C module to trap the authentication and it redirects all the protected Urls to a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
We have a custom Apche C module to trap the authentication and it
redirects all the protected Urls to a SSO java application. And I need to pass additional information to the java application. What is the best way of passing information from Apache to Java? I thought of using http headers, but it doesn't appear to be carried over when I use the REDIERCT status in apache module? Any help in this regard would greatly appreciated. Thanks, - Rithwik. |
|
|||
|
On 26 Feb 2007 12:45:13 -0800
"Rithwik" <sudhar.suba@gmail.com> wrote: > We have a custom Apche C module to trap the authentication and it > redirects all the protected Urls to a SSO java application. And I need > to pass additional information to the java application. What is the > best way of passing information from Apache to Java? I thought of > using http headers, but it doesn't appear to be carried over when I > use the REDIERCT status in apache module? Any help in this regard > would greatly appreciated. A java application is most likely proxied, which is not the same thing as a redirect. But to answer the question in the subject line, when you redirect from apache, the headers_out table is discarded (which is probably your problem), but the err_headers_out table is preserved. Use it. -- Nick Kew Application Development with Apache - the Apache Modules Book http://www.apachetutor.org/ |
|
|||
|
On Feb 26, 1:40 pm, Nick Kew <n...@grimnir.webthing.com> wrote:
> On 26 Feb 2007 12:45:13 -0800 > > "Rithwik" <sudhar.s...@gmail.com> wrote: > > We have a custom Apche C module to trap the authentication and it > > redirects all the protected Urls to a SSO java application. And I need > > to pass additional information to the java application. What is the > > best way of passing information from Apache to Java? I thought of > > using http headers, but it doesn't appear to be carried over when I > > use the REDIERCT status in apache module? Any help in this regard > > would greatly appreciated. > > A java application is most likely proxied, which is not the same > thing as a redirect. > > But to answer the question in the subject line, when you redirect > from apache, the headers_out table is discarded (which is probably > your problem), but the err_headers_out table is preserved. Use it. > > -- > Nick Kew > > Application Development with Apache - the Apache Modules Bookhttp://www.apachetutor.org/ Thanks for your response. But I use err_headers_out to populate the Header. Here is the code snippet I use: apr_table_set(r->err_headers_out, "Location", redirect_address); apr_table_set(r->err_headers_out, "ipaddr12", "12345"); ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Req URL redirected to %s", redirect_address); return HTTP_MOVED_TEMPORARILY ;//OK; HTTP_MOVED_TEMPORARILY; When I use the "OK" status, I see the custom header "ipaddr12". But when I use other two redirects I don't see the header info. FYI: The Location url is being proxied by mod_proxy. I am having nightmare in getting this done. All I need is a mechanism to pass some information from Apache module to java application. I don't want to use the query parameters for obvious reasons. Finally if passing info thru Header is not possible, I might need a code snippet to pass it thru Cookie. Since I am a newbie to C and Apache, the code to create and set cookie, would be greatly useful. Thanks and greatly appreciate your help, - Rithwik |
| Thread Tools | |
| Display Modes | |
|
|