bdaebd
diff --git a/modules/proxy/ajp.h b/modules/proxy/ajp.h
bdaebd
index c119a7e..267150a 100644
bdaebd
--- a/modules/proxy/ajp.h
bdaebd
+++ b/modules/proxy/ajp.h
bdaebd
@@ -413,12 +413,14 @@ apr_status_t ajp_ilink_receive(apr_socket_t *sock, ajp_msg_t *msg);
bdaebd
  * @param sock      backend socket
bdaebd
  * @param r         current request
bdaebd
  * @param buffsize  max size of the AJP packet.
bdaebd
+ * @param secret    authentication secret
bdaebd
  * @param uri       requested uri
bdaebd
  * @return          APR_SUCCESS or error
bdaebd
  */
bdaebd
 apr_status_t ajp_send_header(apr_socket_t *sock, request_rec *r,
bdaebd
                              apr_size_t buffsize,
bdaebd
-                             apr_uri_t *uri);
bdaebd
+                             apr_uri_t *uri,
bdaebd
+                             const char *secret);
bdaebd
 
bdaebd
 /**
bdaebd
  * Read the ajp message and return the type of the message.
bdaebd
diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c
bdaebd
index 67353a7..680a8f3 100644
bdaebd
--- a/modules/proxy/ajp_header.c
bdaebd
+++ b/modules/proxy/ajp_header.c
bdaebd
@@ -213,7 +213,8 @@ AJPV13_REQUEST/AJPV14_REQUEST=
bdaebd
 
bdaebd
 static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
bdaebd
                                           request_rec *r,
bdaebd
-                                          apr_uri_t *uri)
bdaebd
+                                          apr_uri_t *uri,
bdaebd
+                                          const char *secret)
bdaebd
 {
bdaebd
     int method;
bdaebd
     apr_uint32_t i, num_headers = 0;
bdaebd
@@ -293,17 +294,15 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
bdaebd
                    i, elts[i].key, elts[i].val);
bdaebd
     }
bdaebd
 
bdaebd
-/* XXXX need to figure out how to do this
bdaebd
-    if (s->secret) {
bdaebd
+    if (secret) {
bdaebd
         if (ajp_msg_append_uint8(msg, SC_A_SECRET) ||
bdaebd
-            ajp_msg_append_string(msg, s->secret)) {
bdaebd
+            ajp_msg_append_string(msg, secret)) {
bdaebd
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(03228)
bdaebd
-                   "Error ajp_marshal_into_msgb - "
bdaebd
+                   "ajp_marshal_into_msgb: "
bdaebd
                    "Error appending secret");
bdaebd
             return APR_EGENERAL;
bdaebd
         }
bdaebd
     }
bdaebd
- */
bdaebd
 
bdaebd
     if (r->user) {
bdaebd
         if (ajp_msg_append_uint8(msg, SC_A_REMOTE_USER) ||
bdaebd
@@ -671,7 +670,8 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
bdaebd
 apr_status_t ajp_send_header(apr_socket_t *sock,
bdaebd
                              request_rec *r,
bdaebd
                              apr_size_t buffsize,
bdaebd
-                             apr_uri_t *uri)
bdaebd
+                             apr_uri_t *uri,
bdaebd
+                             const char *secret)
bdaebd
 {
bdaebd
     ajp_msg_t *msg;
bdaebd
     apr_status_t rc;
bdaebd
@@ -683,7 +683,7 @@ apr_status_t ajp_send_header(apr_socket_t *sock,
bdaebd
         return rc;
bdaebd
     }
bdaebd
 
bdaebd
-    rc = ajp_marshal_into_msgb(msg, r, uri);
bdaebd
+    rc = ajp_marshal_into_msgb(msg, r, uri, secret);
bdaebd
     if (rc != APR_SUCCESS) {
bdaebd
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00988)
bdaebd
                "ajp_send_header: ajp_marshal_into_msgb failed");
bdaebd
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
bdaebd
index 69a35ce..800ede1 100644
bdaebd
--- a/modules/proxy/mod_proxy.c
bdaebd
+++ b/modules/proxy/mod_proxy.c
bdaebd
@@ -327,6 +327,12 @@ static const char *set_worker_param(apr_pool_t *p,
bdaebd
         worker->s->response_field_size = (s ? s : HUGE_STRING_LEN);
bdaebd
         worker->s->response_field_size_set = 1;
bdaebd
     }
bdaebd
+    else if (!strcasecmp(key, "secret")) {
bdaebd
+        if (PROXY_STRNCPY(worker->s->secret, val) != APR_SUCCESS) {
bdaebd
+            return apr_psprintf(p, "Secret length must be < %d characters",
bdaebd
+                                (int)sizeof(worker->s->secret));
bdaebd
+        }
bdaebd
+    }
bdaebd
     else {
bdaebd
         if (set_worker_hc_param_f) {
bdaebd
             return set_worker_hc_param_f(p, s, worker, key, val, NULL);
bdaebd
diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h
bdaebd
index aabd09f..3419023 100644
bdaebd
--- a/modules/proxy/mod_proxy.h
bdaebd
+++ b/modules/proxy/mod_proxy.h
bdaebd
@@ -357,6 +357,7 @@ PROXY_WORKER_HC_FAIL )
bdaebd
 #define PROXY_WORKER_MAX_HOSTNAME_SIZE  64
bdaebd
 #define PROXY_BALANCER_MAX_HOSTNAME_SIZE PROXY_WORKER_MAX_HOSTNAME_SIZE
bdaebd
 #define PROXY_BALANCER_MAX_STICKY_SIZE  64
bdaebd
+#define PROXY_WORKER_MAX_SECRET_SIZE    64
bdaebd
 
bdaebd
 #define PROXY_RFC1035_HOSTNAME_SIZE	256
bdaebd
 
bdaebd
@@ -450,6 +451,7 @@ typedef struct {
bdaebd
     hcmethod_t      method;     /* method to use for health check */
bdaebd
     apr_interval_time_t interval;
bdaebd
     char      upgrade[PROXY_WORKER_MAX_SCHEME_SIZE];/* upgrade protocol used by mod_proxy_wstunnel */
bdaebd
+    char      secret[PROXY_WORKER_MAX_SECRET_SIZE]; /* authentication secret (e.g. AJP13) */
bdaebd
     char      hostname_ex[PROXY_RFC1035_HOSTNAME_SIZE];  /* RFC1035 compliant version of the remote backend address */
bdaebd
     apr_size_t   response_field_size; /* Size of proxy response buffer in bytes. */
bdaebd
     unsigned int response_field_size_set:1;
bdaebd
diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c
bdaebd
index 73716af..6faabea 100644
bdaebd
--- a/modules/proxy/mod_proxy_ajp.c
bdaebd
+++ b/modules/proxy/mod_proxy_ajp.c
bdaebd
@@ -193,6 +193,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
bdaebd
     apr_off_t content_length = 0;
bdaebd
     int original_status = r->status;
bdaebd
     const char *original_status_line = r->status_line;
bdaebd
+    const char *secret = NULL;
bdaebd
 
bdaebd
     if (psf->io_buffer_size_set)
bdaebd
        maxsize = psf->io_buffer_size;
bdaebd
@@ -202,12 +203,15 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
bdaebd
        maxsize = AJP_MSG_BUFFER_SZ;
bdaebd
     maxsize = APR_ALIGN(maxsize, 1024);
bdaebd
 
bdaebd
+    if (*conn->worker->s->secret)
bdaebd
+        secret = conn->worker->s->secret;
bdaebd
+
bdaebd
     /*
bdaebd
      * Send the AJP request to the remote server
bdaebd
      */
bdaebd
 
bdaebd
     /* send request headers */
bdaebd
-    status = ajp_send_header(conn->sock, r, maxsize, uri);
bdaebd
+    status = ajp_send_header(conn->sock, r, maxsize, uri, secret);
bdaebd
     if (status != APR_SUCCESS) {
bdaebd
         conn->close = 1;
bdaebd
         ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, APLOGNO(00868)