cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [3/3] cxf-fediz git commit: Finished cleaning up the IdP beans
Date Wed, 16 Mar 2016 17:03:10 GMT
Finished cleaning up the IdP beans


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

Branch: refs/heads/master
Commit: ee79fdd1bce7dc547756e78c9616a702646667ba
Parents: 16a974c
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Mar 16 17:00:40 2016 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Mar 16 17:00:40 2016 +0000

----------------------------------------------------------------------
 .../cxf/fediz/service/idp/beans/STSClientAction.java      | 10 ++++------
 .../fediz/service/idp/beans/wsfed/WreplyValidator.java    |  4 +---
 .../webapp/WEB-INF/flows/federation-validate-request.xml  |  2 +-
 .../main/webapp/WEB-INF/flows/saml-validate-request.xml   |  2 +-
 4 files changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/ee79fdd1/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
index ad0a6f4..58a69f3 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
@@ -178,10 +178,10 @@ public class STSClientAction {
      * @return a serialized RP security token
      * @throws Exception
      */
-    public String submit(RequestContext context, String realm)
+    public String submit(RequestContext context, String realm, String homeRealm)
         throws Exception {
         
-        SecurityToken idpToken = getSecurityToken(context);
+        SecurityToken idpToken = getSecurityToken(context, homeRealm);
 
         Bus cxfBus = getBus();
         Idp idpConfig = (Idp) WebUtils.getAttributeFromFlowScope(context, "idpConfig");
@@ -320,14 +320,12 @@ public class STSClientAction {
         return "";
     }
 
-    private SecurityToken getSecurityToken(RequestContext context) throws ProcessingException
{
-        String whr = (String) WebUtils.
-            getAttributeFromFlowScope(context, FederationConstants.PARAM_HOME_REALM);
+    private SecurityToken getSecurityToken(RequestContext context, String homeRealm) throws
ProcessingException {
 
         SecurityToken idpToken = (SecurityToken) WebUtils.getAttributeFromFlowScope(context,
"idpToken");
         if (idpToken != null) {
             LOG.debug("[IDP_TOKEN={} successfully retrieved from cache for home realm [{}]",
-                          idpToken.getId(), whr);
+                          idpToken.getId(), homeRealm);
         } else {
             LOG.error("IDP_TOKEN not found");
             throw new ProcessingException(TYPE.BAD_REQUEST);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/ee79fdd1/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/wsfed/WreplyValidator.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/wsfed/WreplyValidator.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/wsfed/WreplyValidator.java
index 2b542b0..afc8607 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/wsfed/WreplyValidator.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/wsfed/WreplyValidator.java
@@ -21,8 +21,6 @@ package org.apache.cxf.fediz.service.idp.beans.wsfed;
 import java.util.regex.Matcher;
 
 import org.apache.commons.validator.routines.UrlValidator;
-import org.apache.cxf.fediz.core.exception.ProcessingException;
-import org.apache.cxf.fediz.core.exception.ProcessingException.TYPE;
 import org.apache.cxf.fediz.service.idp.domain.Application;
 import org.apache.cxf.fediz.service.idp.domain.Idp;
 import org.apache.cxf.fediz.service.idp.util.WebUtils;
@@ -42,7 +40,7 @@ public class WreplyValidator {
     public boolean isValid(RequestContext context, String wreply, String realm)
         throws Exception {
         if (wreply == null) {
-           return true;
+            return true;
         }
         
         Idp idpConfig = (Idp) WebUtils.getAttributeFromFlowScope(context, "idpConfig");

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/ee79fdd1/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 e64f153..1d489df 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
@@ -137,7 +137,7 @@
     <!-- produce RP security token (as String type) -->
     <action-state id="requestRpToken">
         <on-entry>
-            <evaluate expression="stsClientForRpAction.submit(flowRequestContext, flowScope.wtrealm)"
+            <evaluate expression="stsClientForRpAction.submit(flowRequestContext, flowScope.wtrealm,
flowScope.whr)"
                       result="flowScope.rpToken"/>
         </on-entry>
         <evaluate expression="signinParametersCacheAction.storeRPConfigInSession(flowRequestContext)"
/>

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/ee79fdd1/services/idp/src/main/webapp/WEB-INF/flows/saml-validate-request.xml
----------------------------------------------------------------------
diff --git a/services/idp/src/main/webapp/WEB-INF/flows/saml-validate-request.xml b/services/idp/src/main/webapp/WEB-INF/flows/saml-validate-request.xml
index 1b438ee..4a2667c 100644
--- a/services/idp/src/main/webapp/WEB-INF/flows/saml-validate-request.xml
+++ b/services/idp/src/main/webapp/WEB-INF/flows/saml-validate-request.xml
@@ -65,7 +65,7 @@
         <on-entry>
             <evaluate expression="authnRequestParser.retrieveRealm(flowRequestContext)"

                       result="flowScope.realm"/>
-            <evaluate expression="stsClientForRpAction.submit(flowRequestContext, flowScope.realm)"
+            <evaluate expression="stsClientForRpAction.submit(flowRequestContext, flowScope.realm,
flowScope.whr)"
                       result="flowScope.rpToken"/>
             <evaluate expression="authnRequestParser.retrieveConsumerURL(flowRequestContext)"

                       result="flowScope.consumerURL"/>


Mime
View raw message