On Fri, 16 Apr 2021 at 16:48, Mark H. Wood <[email protected]> wrote:
>
> I'm tinkering with some test CGI scripts to prepare for a real
> project, and I noticed that a script protected by CAS doesn't get a
> value for AUTH_TYPE in its environment, whereas a similar location
> protected by one of the AuthType Basic does.  Am I doing something
> wrong?

No, mod_auth_cas simply does not set ap_auth_type. Does this cause you
any issue?

The attached patch against git master will set it if you'd like it to be set.

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
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-wAxe1tFY7gjkTsn6o5ATfW0%3D3eKMabpW77wZ%2BJjFEu98w%40mail.gmail.com.
diff --git a/src/mod_auth_cas.c b/src/mod_auth_cas.c
index 1791110..910cbe1 100644
--- a/src/mod_auth_cas.c
+++ b/src/mod_auth_cas.c
@@ -2196,6 +2196,7 @@ int cas_authenticate(request_rec *r)
 	if(c->CASPreserveTicket && (ticket != NULL) && (cookieString != NULL) && ap_is_initial_req(r) && isValidCASCookie(r, c, cookieString, &remoteUser, &attrs) && (remoteUser != NULL)) {
 		cas_set_attributes(r, attrs);
 		r->user = remoteUser;
+		r->ap_auth_type = (char * ) "CAS";
 		set_http_headers(r, c, d, attrs);
 		if (c->CASDebug)
 			ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Passing sub-auth response through with ticket parameter intact");
@@ -2243,6 +2244,7 @@ int cas_authenticate(request_rec *r)
 				setCASCookie(r, d->CASGatewayCookie, "TRUE", ssl, CAS_SESSION_EXPIRE_COOKIE_NOW, c->CASGatewayCookieDomain, c->CASCookieSameSite);
 			}
 			r->user = remoteUser;
+			r->ap_auth_type = (char * ) "CAS";
 			if(d->CASAuthNHeader != NULL)
 				apr_table_set(r->headers_in, d->CASAuthNHeader, remoteUser);
 
@@ -2312,6 +2314,7 @@ int cas_authenticate(request_rec *r)
 
 		if(remoteUser) {
 			r->user = remoteUser;
+			r->ap_auth_type = (char * ) "CAS";
 			set_http_headers(r, c, d, attrs);
 			return OK;
 		} else {

Reply via email to