On 21 December 2016 at 04:27, Hansi PIERRE <[email protected]> wrote:
> Hello ... first thank you for the answer.
>
> Le mardi 20 décembre 2016 23:04:48 UTC+1, dhawes a écrit :
>>
>>
>> I'm not sure I follow. What prevents you from using a URL with
>> CASRootProxiedAs?
>
>
> Because my proxified URL has a variable prefix that i'm not aware of in the
> server... something like
> http://[XXXX]-myserver.com/...
> ... but this value can be found in the request's header.
Gotcha, thanks for the clarification.
There's no way to do this currently. Feel free to file a feature
request to the GitHub project and we can discuss further.
I've attached a horrible, inflexible, mostly untested and probably
buggy patch against git master that should rewrite the Host header to
the service URL. Let me know if it works for your case.
--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAAgu-wBxixFrS5g%2BWyXYX6Oh%3DM08AgYF5rDzA8gvUKRBpqnfmQ%40mail.gmail.com.
diff --git a/src/mod_auth_cas.c b/src/mod_auth_cas.c
index 063aab1..988fee5 100644
--- a/src/mod_auth_cas.c
+++ b/src/mod_auth_cas.c
@@ -549,9 +549,18 @@ char *getCASService(const request_rec *r, const cas_cfg *c)
{
const apr_port_t port = r->connection->local_addr->port;
const apr_byte_t ssl = isSSL(r);
- const apr_uri_t *root_proxy = &c->CASRootProxiedAs;
+ //const apr_uri_t *root_proxy = &c->CASRootProxiedAs;
+ apr_uri_t *root_proxy;
char *scheme, *port_str = "", *service;
apr_byte_t print_port = TRUE;
+ apr_uri_t rp;
+ char *host = apr_psprintf(r->pool, "%s%s", "https://", (char *) apr_table_get(r->headers_in, "Host"));
+
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Host: %s", host);
+
+ cas_setURL(r->pool, &rp, host);
+ root_proxy = &rp;
+
#ifdef APACHE2_0
scheme = (char *) ap_http_method(r);