cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: Fixing failing system test
Date Mon, 22 Feb 2016 11:53:15 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master e3cc15f4b -> 59ef5280e


Fixing failing system test


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/59ef5280
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/59ef5280
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/59ef5280

Branch: refs/heads/master
Commit: 59ef5280e32006d02a73bf854086164e1a619b39
Parents: e3cc15f
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Feb 22 11:53:04 2016 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Feb 22 11:53:04 2016 +0000

----------------------------------------------------------------------
 .../idp/beans/SigninParametersCacheAction.java  | 53 +++++++++++---------
 .../TrustedIdpOIDCProtocolHandler.java          |  5 --
 .../flows/federation-validate-request.xml       |  9 +++-
 3 files changed, 37 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/59ef5280/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 a3226bb..7031171 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
@@ -84,32 +84,37 @@ public class SigninParametersCacheAction {
         if (uuidKey == null) {
             uuidKey = (String)WebUtils.getAttributeFromFlowScope(context, OAuthConstants.STATE);
         }
-        @SuppressWarnings("unchecked")
-        Map<String, Object> signinParams =
-            (Map<String, Object>)WebUtils.getAttributeFromExternalContext(context,
uuidKey);
         
-        if (signinParams != null) {
-            String value = (String)signinParams.get(FederationConstants.PARAM_REPLY);
-            if (value != null) {
-                WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_REPLY,
value);
-            }
-            value = (String)signinParams.get(FederationConstants.PARAM_TREALM);
-            if (value != null) {
-                WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_TREALM,
value);
-            }
-            value = (String)signinParams.get(FederationConstants.PARAM_HOME_REALM);
-            if (value != null) {
-                WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_HOME_REALM,
value);
-            }
-            
-            LOG.debug("SignIn parameters restored: {}", signinParams.toString());
-            WebUtils.removeAttributeFromFlowScope(context, FederationConstants.PARAM_CONTEXT);
-            LOG.info("SignIn parameters restored and " + FederationConstants.PARAM_CONTEXT
+ "[" 
-                + uuidKey + "] cleared.");
+        if (uuidKey != null) {
+            @SuppressWarnings("unchecked")
+            Map<String, Object> signinParams =
+                (Map<String, Object>)WebUtils.getAttributeFromExternalContext(context,
uuidKey);
             
-            value = (String)signinParams.get(FederationConstants.PARAM_CONTEXT);
-            if (value != null) {
-                WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_CONTEXT,
value);
+            if (signinParams != null) {
+                String value = (String)signinParams.get(FederationConstants.PARAM_REPLY);
+                if (value != null) {
+                    WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_REPLY,
value);
+                }
+                value = (String)signinParams.get(FederationConstants.PARAM_TREALM);
+                if (value != null) {
+                    WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_TREALM,
value);
+                }
+                value = (String)signinParams.get(FederationConstants.PARAM_HOME_REALM);
+                if (value != null) {
+                    WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_HOME_REALM,
value);
+                }
+                
+                LOG.debug("SignIn parameters restored: {}", signinParams.toString());
+                WebUtils.removeAttributeFromFlowScope(context, FederationConstants.PARAM_CONTEXT);
+                LOG.info("SignIn parameters restored and " + FederationConstants.PARAM_CONTEXT
+ "[" 
+                    + uuidKey + "] cleared.");
+                
+                value = (String)signinParams.get(FederationConstants.PARAM_CONTEXT);
+                if (value != null) {
+                    WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_CONTEXT,
value);
+                }
+            }  else {
+                LOG.debug("Error in restoring security context");
             }
         } else {
             LOG.debug("Error in restoring security context");

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/59ef5280/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpOIDCProtocolHandler.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpOIDCProtocolHandler.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpOIDCProtocolHandler.java
index 28cc37e..b4bc951 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpOIDCProtocolHandler.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpOIDCProtocolHandler.java
@@ -115,11 +115,6 @@ public class TrustedIdpOIDCProtocolHandler implements TrustedIdpProtocolHandler
                 sb.append("&").append(FederationConstants.PARAM_FRESHNESS).append('=');
                 sb.append(URLEncoder.encode(wfresh, "UTF-8"));
             }
-            String wctx = context.getFlowScope().getString(FederationConstants.PARAM_CONTEXT);
-            if (wctx != null) {
-                sb.append("&").append(FederationConstants.PARAM_CONTEXT).append('=');
-                sb.append(wctx);
-            }
              */
             return new URL(sb.toString());
         } catch (MalformedURLException ex) {

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/59ef5280/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 d1277b8..6622ac3 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
@@ -44,7 +44,7 @@
             then="selectSignOutProcess" />
         <if test="requestParameters.wa == 'wsignin1.0'" then="selectWsFedProcess" />
         <if test="requestParameters.SAMLResponse != null" then="selectSAMLProcess"
-            else="signinResponse"
+            else="selectOIDCAuthorizationCodeFlowProcess"
         /> 
     </decision-state>
 
@@ -61,6 +61,13 @@
         <if test="requestParameters.SAMLResponse == null or requestParameters.SAMLResponse.length()
== 0"
             then="viewBadRequest" else="signinResponse" />
     </decision-state>
+    
+    <decision-state id="selectOIDCAuthorizationCodeFlowProcess">
+        <if test="requestParameters.code == null or requestParameters.code.length() ==
0"
+            then="viewBadRequest" />
+        <if test="requestParameters.state == null or requestParameters.state.length()
== 0"
+            then="viewBadRequest" else="signinResponse" />
+    </decision-state>
 	
     <decision-state id="selectSignOutProcess">
         <if test="requestParameters.wa == 'wsignout1.0' and flowScope.idpConfig.rpSingleSignOutConfirmation
== true


Mime
View raw message