Author: anil.saldhana(a)jboss.com
Date: 2009-11-18 23:40:56 -0500 (Wed, 18 Nov 2009)
New Revision: 1032
Added:
migration/picketlink/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/interfaces/SAML2HandlerErrorCodes.java
Modified:
migration/picketlink/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java
migration/picketlink/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2SignatureValidationHandler.java
Log:
start errors
Modified:
migration/picketlink/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java
===================================================================
---
migration/picketlink/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java 2009-11-18
21:51:10 UTC (rev 1031)
+++
migration/picketlink/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java 2009-11-19
04:40:56 UTC (rev 1032)
@@ -641,14 +641,7 @@
if(trace) log.trace(e);
}
}
- }/*
- else
- {
- //User Principal is null
-
- //TODO: Send a formal unauthorized message
- throw new ServletException("Unauthorized");
- }*/
+ }
}
protected void sendErrorResponseToSP(String referrer, Response response, String
relayState,
Added:
migration/picketlink/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/interfaces/SAML2HandlerErrorCodes.java
===================================================================
---
migration/picketlink/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/interfaces/SAML2HandlerErrorCodes.java
(rev 0)
+++
migration/picketlink/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/interfaces/SAML2HandlerErrorCodes.java 2009-11-19
04:40:56 UTC (rev 1032)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.picketlink.identity.federation.core.saml.v2.interfaces;
+
+/**
+ * Error Codes for SAML2 Handlers
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Nov 18, 2009
+ */
+public interface SAML2HandlerErrorCodes
+{
+ int SIGNATURE_INVALID = 100;
+}
\ No newline at end of file
Modified:
migration/picketlink/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2SignatureValidationHandler.java
===================================================================
---
migration/picketlink/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2SignatureValidationHandler.java 2009-11-18
21:51:10 UTC (rev 1031)
+++
migration/picketlink/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2SignatureValidationHandler.java 2009-11-19
04:40:56 UTC (rev 1032)
@@ -26,6 +26,7 @@
import org.apache.log4j.Logger;
import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.core.exceptions.ProcessingException;
+import
org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerErrorCodes;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
@@ -59,7 +60,16 @@
}
}
PublicKey publicKey = (PublicKey)
request.getOptions().get(GeneralConstants.SENDER_PUBLIC_KEY);
- this.validateSender(signedDocument, publicKey);
+ try
+ {
+ this.validateSender(signedDocument, publicKey);
+ }
+ catch(ProcessingException pe)
+ {
+ response.setError(SAML2HandlerErrorCodes.SIGNATURE_INVALID,
+ "Signature Validation Failed");
+ throw pe;
+ }
}
@Override