diff --git a/modules/saml/lib/Auth/Process/AuthnContextClassRef.php b/modules/saml/lib/Auth/Process/AuthnContextClassRef.php
index 4e953c50c377c2ef112713d577cf6fc13371b53e..23743783fd77c18b3eec67ce7227150e30c0ad64 100644
--- a/modules/saml/lib/Auth/Process/AuthnContextClassRef.php
+++ b/modules/saml/lib/Auth/Process/AuthnContextClassRef.php
@@ -29,7 +29,20 @@ class sspmod_saml_Auth_Process_AuthnContextClassRef extends SimpleSAML_Auth_Proc
 		if (!isset($config['AuthnContextClassRef'])) {
 			throw new SimpleSAML_Error_Exception('Missing AuthnContextClassRef option in processing filter.');
 		}
+
+		$this->authnContextClassRef = (string)$config['AuthnContextClassRef'];
 	}
 
 
-}
\ No newline at end of file
+	/**
+	 * Set the AuthnContextClassRef in the SAML 2 response.
+	 *
+	 * @param array &$state  The state array for this request.
+	 */
+	public function process(&$state) {
+		assert('is_array($state)');
+
+		$state['saml:AuthnContextClassRef'] = $this->authnContextClassRef;
+	}
+
+}