[java-idp-testbed COMMIT] in /trunk: pom.xml src/main/java/sp/SAML2Controller.java src/main/webapp/index.html
noreply at shibboleth.net
noreply at shibboleth.net
Fri Aug 28 12:05:04 EDT 2015
Author: tzeller
Date: Fri Aug 28 12:05:04 2015
New Revision: 317
URL: http://svn.shibboleth.net/view/java-idp-testbed?rev=317&view=rev
Log:
IDP-801 - Emulate multiple SPs via the testbed
Bump testbed minor version with addition of this 'feature'.
Modified:
trunk/pom.xml
trunk/src/main/java/sp/SAML2Controller.java
trunk/src/main/webapp/index.html
Modified: trunk/pom.xml
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/pom.xml?rev=317&r1=316&r2=317&view=diff
==============================================================================
--- trunk/pom.xml (original)
+++ trunk/pom.xml Fri Aug 28 12:05:04 2015
@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.shibboleth.idp</groupId>
<artifactId>idp-testbed</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
Modified: trunk/src/main/java/sp/SAML2Controller.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/main/java/sp/SAML2Controller.java?rev=317&r1=316&r2=317&view=diff
==============================================================================
--- trunk/src/main/java/sp/SAML2Controller.java (original)
+++ trunk/src/main/java/sp/SAML2Controller.java Fri Aug 28 12:05:04 2015
@@ -1,7 +1,9 @@
package sp;
import java.net.MalformedURLException;
-
+import java.util.Map;
+
+import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -44,61 +46,66 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.HandlerMapping;
import org.w3c.dom.Element;
@Controller
- at RequestMapping("/SAML2")
+ at RequestMapping({"/SAML2", "/{spId}/SAML2"})
public class SAML2Controller extends BaseSAMLController {
private final Logger log = LoggerFactory.getLogger(SAML2Controller.class);
@RequestMapping(value="/InitSSO/Redirect", method=RequestMethod.GET)
public void initSSORequestRedirect(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception {
- AuthnRequest authnRequest = buildAuthnRequest(servletRequest);
+ final AuthnRequest authnRequest = buildAuthnRequest(servletRequest);
authnRequest.setDestination(getDestinationRedirect(servletRequest, "SSO"));
- MessageContext<SAMLObject> messageContext = buildOutboundMessageContext(authnRequest,
- buildIdpSsoEndpoint(SAMLConstants.SAML2_REDIRECT_BINDING_URI, authnRequest.getDestination()));
+ final Endpoint endpoint = buildIdpSsoEndpoint(SAMLConstants.SAML2_REDIRECT_BINDING_URI, authnRequest.getDestination());
+ final String idpEntityID = getIdpEntityId(servletRequest);
+ final MessageContext<SAMLObject> messageContext = buildOutboundMessageContext(authnRequest, endpoint, idpEntityID);
encodeOutboundMessageContextRedirect(messageContext, servletResponse);
}
@RequestMapping(value="/InitSSO/POST", method=RequestMethod.GET)
public void initSSORequestPost(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception {
- AuthnRequest authnRequest = buildAuthnRequest(servletRequest);
+ final AuthnRequest authnRequest = buildAuthnRequest(servletRequest);
authnRequest.setDestination(getDestinationPost(servletRequest, "SSO"));
- MessageContext<SAMLObject> messageContext = buildOutboundMessageContext(authnRequest,
- buildIdpSsoEndpoint(SAMLConstants.SAML2_POST_BINDING_URI, authnRequest.getDestination()));
+ final Endpoint endpoint = buildIdpSsoEndpoint(SAMLConstants.SAML2_POST_BINDING_URI, authnRequest.getDestination());
+ final String idpEntityID = getIdpEntityId(servletRequest);
+ final MessageContext<SAMLObject> messageContext = buildOutboundMessageContext(authnRequest, endpoint, idpEntityID);
SAMLMessageSecuritySupport.signMessage(messageContext);
encodeOutboundMessageContextPost(messageContext, servletResponse);
}
@RequestMapping(value="/InitSSO/Passive", method=RequestMethod.GET)
public void initSSORequestPassive(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception {
- AuthnRequest authnRequest = buildAuthnRequest(servletRequest);
+ final AuthnRequest authnRequest = buildAuthnRequest(servletRequest);
authnRequest.setDestination(getDestinationRedirect(servletRequest, "SSO"));
authnRequest.setIsPassive(true);
- MessageContext<SAMLObject> messageContext = buildOutboundMessageContext(authnRequest,
- buildIdpSsoEndpoint(SAMLConstants.SAML2_REDIRECT_BINDING_URI, authnRequest.getDestination()));
+ final Endpoint endpoint = buildIdpSsoEndpoint(SAMLConstants.SAML2_REDIRECT_BINDING_URI, authnRequest.getDestination());
+ final String idpEntityID = getIdpEntityId(servletRequest);
+ final MessageContext<SAMLObject> messageContext = buildOutboundMessageContext(authnRequest, endpoint, idpEntityID);
[... 316 lines stripped ...]
More information about the commits
mailing list