[java-idp-testbed] branch main updated: Add SAML DeclRef option.

Scott Cantor cantor.2 at osu.edu
Thu Feb 22 17:16:27 UTC 2024


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-idp-testbed.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-testbed.git;a=commit;h=840dc40c4ec6c491e3d45b0a54e31d09b1fd8bd8

The following commit(s) were added to refs/heads/main by this push:
     new 840dc40  Add SAML DeclRef option.
840dc40 is described below

commit 840dc40c4ec6c491e3d45b0a54e31d09b1fd8bd8
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Feb 22 12:15:58 2024 -0500

    Add SAML DeclRef option.
---
 src/main/java/sp/SAML2Controller.java | 13 +++++++++++++
 src/main/webapp/index.html            |  5 +++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/main/java/sp/SAML2Controller.java b/src/main/java/sp/SAML2Controller.java
index e22e522..b5594bd 100644
--- a/src/main/java/sp/SAML2Controller.java
+++ b/src/main/java/sp/SAML2Controller.java
@@ -62,6 +62,7 @@ import org.opensaml.saml.saml2.binding.encoding.impl.HTTPRedirectDeflateEncoder;
 import org.opensaml.saml.saml2.binding.encoding.impl.HTTPSOAP11Encoder;
 import org.opensaml.saml.saml2.core.AttributeQuery;
 import org.opensaml.saml.saml2.core.AuthnContextClassRef;
+import org.opensaml.saml.saml2.core.AuthnContextDeclRef;
 import org.opensaml.saml.saml2.core.AuthnRequest;
 import org.opensaml.saml.saml2.core.Extensions;
 import org.opensaml.saml.saml2.core.IDPEntry;
@@ -587,6 +588,18 @@ public class SAML2Controller extends BaseSAMLController {
 	        rac.getAuthnContextClassRefs().add(ref);
 	        authnRequest.setRequestedAuthnContext(rac);
 		}
+
+        param = StringSupport.trimOrNull(servletRequest.getParameter("declRef"));
+        if (param != null) {
+            final AuthnContextDeclRef ref = (AuthnContextDeclRef) builderFactory.ensureBuilder(
+                    AuthnContextDeclRef.DEFAULT_ELEMENT_NAME).buildObject(AuthnContextDeclRef.DEFAULT_ELEMENT_NAME);
+            ref.setURI(param);
+            final RequestedAuthnContext rac = (RequestedAuthnContext) builderFactory.ensureBuilder(
+                    RequestedAuthnContext.DEFAULT_ELEMENT_NAME).buildObject(
+                            RequestedAuthnContext.DEFAULT_ELEMENT_NAME);
+            rac.getAuthnContextDeclRefs().add(ref);
+            authnRequest.setRequestedAuthnContext(rac);
+        }
 		
 		param = StringSupport.trimOrNull(servletRequest.getParameter("requesters"));
 		if (param != null) {
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html
index 787074c..5ae2bc4 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.html
@@ -21,13 +21,14 @@
 <li><a href="sp/SAML2/InitSSO/POST">Init SAML 2 SSO, POST Binding</a></li>
 <li><a href="sp/SAML2/InitSSO/POST/Passive">Init SAML 2 SSO, POST Binding, Passive Request</a></li>
 <li><a href="sp/SAML2/InitSSO/POST/ForceAuthn">Init SAML 2 SSO, POST Binding, ForceAuthn Request</a></li>
-<li><a href="idp/profile/SAML2/Unsolicited/SSO?providerId=https://sp.example.org&shire=https://localhost:8443/sp/SAML2/POST/ACS&target=MyRelayState">IdP-initiated (Unsolicited) SAML 2 SSO</a></li>
-<li><a href="idp/profile/Shibboleth/SSO?providerId=https://sp.example.org&shire=https://localhost:8443/sp/SAML1/POST/ACS&target=MyRelayState">IdP-initiated (Unsolicited) SAML 1 SSO</a></li>
+<li><a href="idp/profile/SAML2/Unsolicited/SSO?providerId=https://sp.example.org&shire=https://localhost/sp/SAML2/POST/ACS&target=MyRelayState">IdP-initiated (Unsolicited) SAML 2 SSO</a></li>
+<li><a href="idp/profile/Shibboleth/SSO?providerId=https://sp.example.org&shire=https://localhost/sp/SAML1/POST/ACS&target=MyRelayState">IdP-initiated (Unsolicited) SAML 1 SSO</a></li>
 
 <li>
 <form action="sp/SAML2/InitSSO/Redirect" method="GET">
     <p>Init SAML 2 SSO, Redirect Binding with:<br/>
     AuthnContextClassRef: <input type="text" name="classRef" size="60"/><br/>
+    AuthnContextDeclRef: <input type="text" name="declRef" size="60"/><br/>
     Scoping ProxyCount: <input type="text" name="proxycount" size="20"/><br/>
     Scoping Requesters: <input type="text" name="requesters" size="60"/><br/>
     Scoping IdPs: <input type="text" name="idplist" size="60"/><br/>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list