More refactoring
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/4a08fe5b Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/4a08fe5b Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/4a08fe5b Branch: refs/heads/master Commit: 4a08fe5bea001bdf64a10488067f17ec6464f48f Parents: 31c7552 Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Dec 14 11:45:28 2016 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Dec 14 11:45:28 2016 +0000 ---------------------------------------------------------------------- .../idp/beans/SigninParametersCacheAction.java | 40 ++++++++++---------- .../flows/federation-validate-request.xml | 4 +- .../webapp/WEB-INF/flows/signin-request.xml | 2 - .../webapp/WEB-INF/flows/signin-response.xml | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4a08fe5b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java ---------------------------------------------------------------------- diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java index 538841d..bbecc5a 100644 --- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java +++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java @@ -54,17 +54,20 @@ public class SigninParametersCacheAction { if (value != null) { signinParams.put(IdpConstants.CONTEXT, value); } + value = WebUtils.getAttributeFromFlowScope(context, IdpConstants.REALM); + if (value != null) { + signinParams.put(IdpConstants.REALM, value); + } + value = WebUtils.getAttributeFromFlowScope(context, IdpConstants.RETURN_ADDRESS); + if (value != null) { + signinParams.put(IdpConstants.RETURN_ADDRESS, value); + } + value = WebUtils.getAttributeFromFlowScope(context, IdpConstants.RETURN_ADDRESS); + if (value != null) { + signinParams.put(IdpConstants.RETURN_ADDRESS, value); + } - if ("wsfed".equals(protocol)) { - value = WebUtils.getAttributeFromFlowScope(context, IdpConstants.RETURN_ADDRESS); - if (value != null) { - signinParams.put(FederationConstants.PARAM_REPLY, value); - } - value = WebUtils.getAttributeFromFlowScope(context, IdpConstants.REALM); - if (value != null) { - signinParams.put(IdpConstants.REALM, value); - } - } else if ("samlsso".equals(protocol)) { + if ("samlsso".equals(protocol)) { value = WebUtils.getAttributeFromFlowScope(context, IdpConstants.SAML_AUTHN_REQUEST); if (value != null) { signinParams.put(IdpConstants.SAML_AUTHN_REQUEST, value); @@ -96,12 +99,16 @@ public class SigninParametersCacheAction { if (value != null) { WebUtils.putAttributeInFlowScope(context, IdpConstants.REALM, value); } + value = (String)signinParams.get(IdpConstants.RETURN_ADDRESS); + if (value != null) { + WebUtils.putAttributeInFlowScope(context, IdpConstants.RETURN_ADDRESS, value); + } + value = (String)signinParams.get(IdpConstants.CONTEXT); + if (value != null) { + WebUtils.putAttributeInFlowScope(context, IdpConstants.CONTEXT, value); + } if ("wsfed".equals(protocol)) { - value = (String)signinParams.get(FederationConstants.PARAM_REPLY); - if (value != null) { - WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_REPLY, value); - } WebUtils.removeAttributeFromFlowScope(context, FederationConstants.PARAM_CONTEXT); LOG.info("SignIn parameters restored and " + FederationConstants.PARAM_CONTEXT + "[" @@ -115,11 +122,6 @@ public class SigninParametersCacheAction { } } - value = (String)signinParams.get(IdpConstants.CONTEXT); - if (value != null) { - WebUtils.putAttributeInFlowScope(context, IdpConstants.CONTEXT, value); - } - } else { LOG.debug("Error in restoring security context"); } http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4a08fe5b/services/idp/src/main/webapp/WEB-INF/flows/federation-validate-request.xml ---------------------------------------------------------------------- diff --git a/services/idp/src/main/webapp/WEB-INF/flows/federation-validate-request.xml b/services/idp/src/main/webapp/WEB-INF/flows/federation-validate-request.xml index 52b5d04..3581ef2 100644 --- a/services/idp/src/main/webapp/WEB-INF/flows/federation-validate-request.xml +++ b/services/idp/src/main/webapp/WEB-INF/flows/federation-validate-request.xml @@ -134,7 +134,7 @@ <input name="protocol" value="'wsfed'" /> <output name="realm" /> - <output name="wreply" /> + <output name="return_address" /> <output name="request_context" /> <output name="home_realm" /> <output name="idpToken" /> @@ -143,7 +143,7 @@ <set name="flowScope.whr" value="currentEvent.attributes.home_realm" /> <set name="flowScope.wctx" value="currentEvent.attributes.request_context" /> <set name="flowScope.wtrealm" value="currentEvent.attributes.realm" /> - <set name="flowScope.wreply" value="currentEvent.attributes.wreply" /> + <set name="flowScope.wreply" value="currentEvent.attributes.return_address" /> <set name="flowScope.idpToken" value="currentEvent.attributes.idpToken" /> </transition> <transition on="viewBadRequest" to="viewBadRequest" /> http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4a08fe5b/services/idp/src/main/webapp/WEB-INF/flows/signin-request.xml ---------------------------------------------------------------------- diff --git a/services/idp/src/main/webapp/WEB-INF/flows/signin-request.xml b/services/idp/src/main/webapp/WEB-INF/flows/signin-request.xml index 78b149e..d618c76 100644 --- a/services/idp/src/main/webapp/WEB-INF/flows/signin-request.xml +++ b/services/idp/src/main/webapp/WEB-INF/flows/signin-request.xml @@ -115,8 +115,6 @@ <!-- Here, home realm is guaranteed to be THIS realm --> <set name="flowScope.home_realm" value="flowScope.idpConfig.realm" /> </on-entry> - <if test="flowScope.idpConfig.getAuthenticationURIs() == null" - then="viewBadRequest" /> <!-- check presence of cached IDP token for THIS realm --> <if test="externalContext.sessionMap[flowScope.home_realm] == null" http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4a08fe5b/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 4f63155..ebfbf1f 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 @@ -67,7 +67,7 @@ subflow to get a RP token from the STS. <end-state id="requestRpToken"> <output name="home_realm" value="flowScope.home_realm" /> <output name="request_context" value="flowScope.request_context" /> - <output name="wreply" value="flowScope.wreply" /> + <output name="return_address" value="flowScope.return_address" /> <output name="realm" value="flowScope.realm" /> <output name="idpToken" value="flowScope.idpToken" /> <output name="saml_authn_request" value="flowScope.saml_authn_request" />
