Repository: cxf-fediz Updated Branches: refs/heads/master 799bfa5a7 -> 76e9fee79
Fixing response creation for SAML SSO Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/76e9fee7 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/76e9fee7 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/76e9fee7 Branch: refs/heads/master Commit: 76e9fee79f755e2151fb035575305ae87e78fbdd Parents: 799bfa5 Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Dec 7 18:38:40 2016 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Dec 7 18:38:40 2016 +0000 ---------------------------------------------------------------------- .../idp/protocols/TrustedIdpSAMLProtocolHandler.java | 3 ++- .../idp/src/main/webapp/WEB-INF/flows/signin-response.xml | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/76e9fee7/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java ---------------------------------------------------------------------- diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java index 4214705..7b8c3eb 100644 --- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java +++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java @@ -34,6 +34,7 @@ import java.util.zip.DataFormatException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.BadRequestException; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.UriBuilder; @@ -209,7 +210,7 @@ public class TrustedIdpSAMLProtocolHandler extends AbstractTrustedIdpProtocolHan + System.getProperty("line.separator") + validatorResponse.getAssertion()); } return idpToken; - } catch (IllegalStateException ex) { + } catch (BadRequestException ex) { throw ex; } catch (Exception ex) { LOG.warn("Unexpected exception occured", ex); http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/76e9fee7/services/idp/src/main/webapp/WEB-INF/flows/signin-response.xml ---------------------------------------------------------------------- diff --git a/services/idp/src/main/webapp/WEB-INF/flows/signin-response.xml b/services/idp/src/main/webapp/WEB-INF/flows/signin-response.xml index 38c4392..9a5b123 100644 --- a/services/idp/src/main/webapp/WEB-INF/flows/signin-response.xml +++ b/services/idp/src/main/webapp/WEB-INF/flows/signin-response.xml @@ -49,8 +49,9 @@ subflow to get a RP token from the STS. result="flowScope.idpToken" result-type="org.apache.cxf.ws.security.tokenstore.SecurityToken" /> <transition to="checkCacheTrustedIdpToken" /> <transition - on-exception="org.apache.cxf.fediz.core.exception.ProcessingException" - to="viewBadRequest" /> + on-exception="org.apache.cxf.fediz.core.exception.ProcessingException" to="viewBadRequest" /> + <transition + on-exception="javax.ws.rs.BadRequestException" to="viewBadRequest" /> <transition on-exception="java.lang.Throwable" to="scInternalServerError" /> </action-state> @@ -74,7 +75,10 @@ subflow to get a RP token from the STS. </end-state> <!-- abnormal exit point : Http 400 Bad Request --> - <end-state id="viewBadRequest" /> + <end-state id="viewBadRequest"> + <output name="saml_authn_request" value="flowScope.saml_authn_request" /> + <output name="RelayState" value="flowScope.RelayState" /> + </end-state> <!-- abnormal exit point : Http 500 Internal Server Error --> <end-state id="scInternalServerError" />
