You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2016/12/08 10:26:43 UTC

cxf-fediz git commit: Fixing support for SAML SSO protocol in configuration

Repository: cxf-fediz
Updated Branches:
  refs/heads/master 76e9fee79 -> d4f862d93


Fixing support for SAML SSO protocol in configuration


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

Branch: refs/heads/master
Commit: d4f862d9397dea6e50d689f685d27640527673eb
Parents: 76e9fee
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Thu Dec 8 10:12:15 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Thu Dec 8 10:12:15 2016 +0000

----------------------------------------------------------------------
 .../service/idp/beans/STSClientAction.java      |  5 --
 .../ApplicationSAMLSSOProtocolHandler.java      | 57 ++++++++++++++++++++
 .../test/resources/realma/entities-realma.xml   |  6 +--
 3 files changed, 60 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d4f862d9/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 0c01352..0d6c37d 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
@@ -272,11 +272,6 @@ public class STSClientAction {
         sts.setEnableAppliesTo(serviceConfig.isEnableAppliesTo());
         
         sts.setOnBehalfOf(idpToken.getToken());
-        if (!(serviceConfig.getProtocol() == null
-            || FederationConstants.WS_FEDERATION_NS.equals(serviceConfig.getProtocol()))) {
-            LOG.error("Protocol {} not supported for realm {} ", serviceConfig.getProtocol(), realm);
-            throw new ProcessingException(TYPE.BAD_REQUEST);
-        }
        
         if (properties != null) {
             sts.setProperties(properties);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d4f862d9/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/ApplicationSAMLSSOProtocolHandler.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/ApplicationSAMLSSOProtocolHandler.java b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/ApplicationSAMLSSOProtocolHandler.java
new file mode 100644
index 0000000..ebab362
--- /dev/null
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/protocols/ApplicationSAMLSSOProtocolHandler.java
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.fediz.service.idp.protocols;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.cxf.fediz.service.idp.spi.ApplicationProtocolHandler;
+
+import org.springframework.stereotype.Component;
+import org.springframework.webflow.execution.RequestContext;
+
+@Component
+public class ApplicationSAMLSSOProtocolHandler implements ApplicationProtocolHandler {
+    
+    public static final String PROTOCOL = "urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser";
+
+    //private static final Logger LOG = LoggerFactory.getLogger(ApplicationWSFedProtocolHandler.class);
+
+    @Override
+    public boolean canHandleRequest(HttpServletRequest request) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public String getProtocol() {
+        return PROTOCOL;
+    }
+
+    @Override
+    public void mapSignInRequest(RequestContext context) {
+        // TODO Auto-generated method stub
+    }
+
+    @Override
+    public void mapSignInResponse(RequestContext context) {
+        // TODO Auto-generated method stub
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d4f862d9/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml
----------------------------------------------------------------------
diff --git a/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml b/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml
index 6e840f5..714dbd4 100644
--- a/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml
+++ b/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml
@@ -137,7 +137,7 @@
 
     <bean id="srv-fedizhelloworld-realmB" class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationEntity">
         <property name="realm" value="urn:org:apache:cxf:fediz:fedizhelloworld:realm-B" />
-        <property name="protocol" value="http://docs.oasis-open.org/wsfed/federation/200706" />
+        <property name="protocol" value="urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser" />
         <property name="serviceDisplayName" value="Fedizhelloworld" />
         <property name="serviceDescription" value="Web Application to illustrate SAML SSO" />
         <property name="role" value="ApplicationServiceType" />
@@ -150,7 +150,7 @@
     
     <bean id="srv-fedizhelloworld-realmC" class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationEntity">
         <property name="realm" value="urn:org:apache:cxf:fediz:fedizhelloworld:realm-C" />
-        <property name="protocol" value="http://docs.oasis-open.org/wsfed/federation/200706" />
+        <property name="protocol" value="urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser" />
         <property name="serviceDisplayName" value="Fedizhelloworld" />
         <property name="serviceDescription" value="Web Application to illustrate SAML SSO" />
         <property name="role" value="ApplicationServiceType" />
@@ -163,7 +163,7 @@
     
     <bean id="srv-fedizhelloworld-realmD" class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationEntity">
         <property name="realm" value="urn:org:apache:cxf:fediz:fedizhelloworld:realm-D" />
-        <property name="protocol" value="http://docs.oasis-open.org/wsfed/federation/200706" />
+        <property name="protocol" value="urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser" />
         <property name="serviceDisplayName" value="Fedizhelloworld" />
         <property name="serviceDescription" value="Web Application to illustrate SAML SSO" />
         <property name="role" value="ApplicationServiceType" />