[java-shib-idp2 COMMIT] /branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPP...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Feb 1 15:40:04 EST 2013
Author: scantor
Date: Fri Feb 1 15:40:03 2013
New Revision: 3132
URL: http://svn.shibboleth.net/view/java-shib-idp2?rev=3132&view=rev
Log:
SIDP-558: Added CB support and key generation to ECP handler
Modified:
branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java
Modified: branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java?rev=3132&r1=3131&r2=3132&view=diff
==============================================================================
--- branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java (original)
+++ branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java Fri Feb 1 15:40:03 2013
@@ -19,10 +19,13 @@
import java.io.OutputStreamWriter;
import java.io.Writer;
+import java.security.SecureRandom;
import java.util.ArrayList;
+import java.util.List;
import javax.servlet.http.HttpServletRequest;
+import org.apache.xml.security.utils.Base64;
import org.joda.time.DateTime;
import org.opensaml.Configuration;
import org.opensaml.common.SAMLObjectBuilder;
@@ -30,6 +33,9 @@
import org.opensaml.common.xml.SAMLConstants;
import org.opensaml.saml2.binding.decoding.HandlerChainAwareHTTPSOAP11Decoder;
import org.opensaml.saml2.binding.encoding.HandlerChainAwareHTTPSOAP11Encoder;
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.saml2.core.Advice;
+import org.opensaml.saml2.core.Assertion;
import org.opensaml.saml2.core.AttributeStatement;
import org.opensaml.saml2.core.AuthnContext;
import org.opensaml.saml2.core.AuthnContextClassRef;
@@ -40,12 +46,16 @@
import org.opensaml.saml2.core.StatusCode;
import org.opensaml.saml2.core.Subject;
import org.opensaml.saml2.core.SubjectConfirmation;
+import org.opensaml.saml2.ecp.RequestAuthenticated;
import org.opensaml.saml2.metadata.SPSSODescriptor;
+import org.opensaml.samlext.saml2cb.ChannelBindings;
+import org.opensaml.samlext.samlec.GeneratedKey;
import org.opensaml.ws.message.decoder.MessageDecodingException;
import org.opensaml.ws.transport.http.HTTPInTransport;
import org.opensaml.ws.transport.http.HTTPOutTransport;
import org.opensaml.ws.transport.http.HttpServletRequestAdapter;
+import org.opensaml.xml.XMLObject;
import org.opensaml.xml.security.SecurityException;
import org.opensaml.xml.util.DatatypeHelper;
import org.slf4j.Logger;
@@ -56,6 +66,7 @@
import edu.internet2.middleware.shibboleth.common.relyingparty.ProfileConfiguration;
import edu.internet2.middleware.shibboleth.common.relyingparty.RelyingPartyConfiguration;
import edu.internet2.middleware.shibboleth.common.relyingparty.provider.saml2.ECPConfiguration;
+import edu.internet2.middleware.shibboleth.idp.profile.saml2.SSOProfileHandler.SSORequestContext;
import org.opensaml.ws.message.handler.BasicHandlerChain;
import org.opensaml.ws.message.handler.Handler;
@@ -65,6 +76,7 @@
import org.opensaml.ws.message.handler.StaticHandlerChainResolver;
import org.opensaml.ws.message.MessageContext;
import org.opensaml.ws.soap.soap11.ActorBearing;
+import org.opensaml.ws.soap.soap11.Envelope;
import org.opensaml.ws.soap.util.SOAPHelper;
import org.opensaml.common.binding.SAMLMessageContext;
@@ -76,12 +88,27 @@
/** Class logger. */
private final Logger log = LoggerFactory.getLogger(SAML2ECPProfileHandler.class);
+ /** A {@link SecureRandom} PRNG to generate session keys. */
+ private final SecureRandom prng = new SecureRandom();
+
/** A context class reference to insert into the assertion. */
private String authnContextClassRef = AuthnContext.PPT_AUTHN_CTX;
/** Builder of ECP Response object. */
private SAMLObjectBuilder<org.opensaml.saml2.ecp.Response> ecpResponseBuilder;
+ /** Builder of RequestAuthenticated objects. */
+ private SAMLObjectBuilder<RequestAuthenticated> reqAuthnBuilder;
+
+ /** Builder of ChannelBindings objects. */
+ private SAMLObjectBuilder<ChannelBindings> cbBuilder;
+
+ /** Builder of GeneratedKey objects. */
+ private SAMLObjectBuilder<GeneratedKey> keyBuilder;
+
+ /** Builder of Advice objects. */
+ private SAMLObjectBuilder<Advice> adviceBuilder;
+
/** Builder of AuthnContext objects. */
private SAMLObjectBuilder<AuthnContext> authnContextBuilder;
@@ -103,8 +130,8 @@
/** SOAP message decoder to use. */
private SAMLMessageDecoder messageDecoder;
- // canned soap fauilt
- private static String soapFaultResponseMessage =
+ /** SOAP fault message. */
+ private final String soapFaultResponseMessage =
"<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
" <env:Body>" +
" <env:Fault>" +
@@ -120,13 +147,21 @@
* Constructor.
*
*/
- @SuppressWarnings("unchecked")
public SAML2ECPProfileHandler() {
[... 324 lines stripped ...]
More information about the commits
mailing list