gatein SVN: r8337 - components/sso/tags.
by do-not-reply@jboss.org
Author: mposolda
Date: 2012-02-01 05:29:22 -0500 (Wed, 01 Feb 2012)
New Revision: 8337
Added:
components/sso/tags/1.1.1-CR01/
Log:
[maven-release-plugin] copy for tag 1.1.1-CR01
12 years, 11 months
gatein SVN: r8336 - in components/sso/trunk: agent and 17 other directories.
by do-not-reply@jboss.org
Author: mposolda
Date: 2012-02-01 05:29:08 -0500 (Wed, 01 Feb 2012)
New Revision: 8336
Modified:
components/sso/trunk/agent/pom.xml
components/sso/trunk/auth-callback/pom.xml
components/sso/trunk/cas/gatein-cas-plugin/pom.xml
components/sso/trunk/cas/gatein-cas-portal/pom.xml
components/sso/trunk/cas/pom.xml
components/sso/trunk/josso/gatein-agent-josso181/pom.xml
components/sso/trunk/josso/gatein-agent-josso182/pom.xml
components/sso/trunk/josso/gatein-josso-plugin/pom.xml
components/sso/trunk/josso/gatein-josso-portal/pom.xml
components/sso/trunk/josso/pom.xml
components/sso/trunk/opensso/gatein-opensso-plugin/pom.xml
components/sso/trunk/opensso/gatein-opensso-portal/pom.xml
components/sso/trunk/opensso/pom.xml
components/sso/trunk/packaging/pom.xml
components/sso/trunk/pom.xml
components/sso/trunk/saml/gatein-saml-plugin/pom.xml
components/sso/trunk/saml/gatein-saml-portal/pom.xml
components/sso/trunk/saml/pom.xml
components/sso/trunk/spnego/pom.xml
Log:
[maven-release-plugin] prepare release 1.1.1-CR01
Modified: components/sso/trunk/agent/pom.xml
===================================================================
--- components/sso/trunk/agent/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/agent/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -3,7 +3,7 @@
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/sso/trunk/auth-callback/pom.xml
===================================================================
--- components/sso/trunk/auth-callback/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/auth-callback/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -3,7 +3,7 @@
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/sso/trunk/cas/gatein-cas-plugin/pom.xml
===================================================================
--- components/sso/trunk/cas/gatein-cas-plugin/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/cas/gatein-cas-plugin/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -3,7 +3,7 @@
<groupId>org.gatein.sso</groupId>
<artifactId>sso-cas-parent</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/sso/trunk/cas/gatein-cas-portal/pom.xml
===================================================================
--- components/sso/trunk/cas/gatein-cas-portal/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/cas/gatein-cas-portal/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -3,7 +3,7 @@
<groupId>org.gatein.sso</groupId>
<artifactId>sso-cas-parent</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/sso/trunk/cas/pom.xml
===================================================================
--- components/sso/trunk/cas/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/cas/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/josso/gatein-agent-josso181/pom.xml
===================================================================
--- components/sso/trunk/josso/gatein-agent-josso181/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/josso/gatein-agent-josso181/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -1,9 +1,8 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sso-josso-parent</artifactId>
<groupId>org.gatein.sso</groupId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/sso/trunk/josso/gatein-agent-josso182/pom.xml
===================================================================
--- components/sso/trunk/josso/gatein-agent-josso182/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/josso/gatein-agent-josso182/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -1,9 +1,8 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sso-josso-parent</artifactId>
<groupId>org.gatein.sso</groupId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/sso/trunk/josso/gatein-josso-plugin/pom.xml
===================================================================
--- components/sso/trunk/josso/gatein-josso-plugin/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/josso/gatein-josso-plugin/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-josso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/josso/gatein-josso-portal/pom.xml
===================================================================
--- components/sso/trunk/josso/gatein-josso-portal/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/josso/gatein-josso-portal/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-josso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/josso/pom.xml
===================================================================
--- components/sso/trunk/josso/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/josso/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/opensso/gatein-opensso-plugin/pom.xml
===================================================================
--- components/sso/trunk/opensso/gatein-opensso-plugin/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/opensso/gatein-opensso-plugin/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -3,7 +3,7 @@
<groupId>org.gatein.sso</groupId>
<artifactId>sso-opensso-parent</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/sso/trunk/opensso/gatein-opensso-portal/pom.xml
===================================================================
--- components/sso/trunk/opensso/gatein-opensso-portal/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/opensso/gatein-opensso-portal/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-opensso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/opensso/pom.xml
===================================================================
--- components/sso/trunk/opensso/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/opensso/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/packaging/pom.xml
===================================================================
--- components/sso/trunk/packaging/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/packaging/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/pom.xml
===================================================================
--- components/sso/trunk/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<packaging>pom</packaging>
<parent>
@@ -25,9 +25,9 @@
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/sso/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/sso/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/sso/trunk</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/sso/tags/1.1.1-CR01</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/sso/tags/1.1.1-CR01</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/sso/tags/1.1.1-CR01</url>
</scm>
Modified: components/sso/trunk/saml/gatein-saml-plugin/pom.xml
===================================================================
--- components/sso/trunk/saml/gatein-saml-plugin/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/saml/gatein-saml-plugin/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -1,9 +1,8 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sso-saml-parent</artifactId>
<groupId>org.gatein.sso</groupId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/saml/gatein-saml-portal/pom.xml
===================================================================
--- components/sso/trunk/saml/gatein-saml-portal/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/saml/gatein-saml-portal/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -1,9 +1,8 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sso-saml-parent</artifactId>
<groupId>org.gatein.sso</groupId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/saml/pom.xml
===================================================================
--- components/sso/trunk/saml/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/saml/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -21,12 +21,11 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/sso/trunk/spnego/pom.xml
===================================================================
--- components/sso/trunk/spnego/pom.xml 2012-02-01 10:20:31 UTC (rev 8335)
+++ components/sso/trunk/spnego/pom.xml 2012-02-01 10:29:08 UTC (rev 8336)
@@ -3,7 +3,7 @@
<groupId>org.gatein.sso</groupId>
<artifactId>sso-parent</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.1.1-CR01-SNAPSHOT</version>
+ <version>1.1.1-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
12 years, 11 months
gatein SVN: r8335 - in components/sso/trunk: agent and 10 other directories.
by do-not-reply@jboss.org
Author: mposolda
Date: 2012-02-01 05:20:31 -0500 (Wed, 01 Feb 2012)
New Revision: 8335
Modified:
components/sso/trunk/
components/sso/trunk/agent/
components/sso/trunk/auth-callback/
components/sso/trunk/cas/gatein-cas-plugin/
components/sso/trunk/cas/gatein-cas-portal/
components/sso/trunk/josso/gatein-agent-josso182/
components/sso/trunk/josso/gatein-josso-plugin/
components/sso/trunk/josso/gatein-josso-portal/
components/sso/trunk/opensso/gatein-opensso-plugin/
components/sso/trunk/opensso/gatein-opensso-portal/
components/sso/trunk/saml/gatein-saml-plugin/
components/sso/trunk/spnego/
Log:
svn:ignore update
Property changes on: components/sso/trunk
___________________________________________________________________
Modified: svn:ignore
- *.iml
+ *.iml
.idea
Property changes on: components/sso/trunk/agent
___________________________________________________________________
Modified: svn:ignore
- target
*.iml
+ target
*.iml
.classpath
.project
.settings
Property changes on: components/sso/trunk/auth-callback
___________________________________________________________________
Modified: svn:ignore
- target
*.iml
+ target
*.iml
.classpath
.project
.settings
Property changes on: components/sso/trunk/cas/gatein-cas-plugin
___________________________________________________________________
Modified: svn:ignore
- target
+ target
.classpath
.project
sso-cas-plugin.iml
.settings
Property changes on: components/sso/trunk/cas/gatein-cas-portal
___________________________________________________________________
Modified: svn:ignore
- target
+ target
sso-cas-pkg.iml
Property changes on: components/sso/trunk/josso/gatein-agent-josso182
___________________________________________________________________
Added: svn:ignore
+ sso-agent-josso182.iml
Property changes on: components/sso/trunk/josso/gatein-josso-plugin
___________________________________________________________________
Modified: svn:ignore
- target
+ target
.classpath
sso-josso-plugin.iml
.project
.settings
Property changes on: components/sso/trunk/josso/gatein-josso-portal
___________________________________________________________________
Modified: svn:ignore
- target
+ target
sso-josso-pkg.iml
Property changes on: components/sso/trunk/opensso/gatein-opensso-plugin
___________________________________________________________________
Modified: svn:ignore
- target
+ target
.classpath
.project
sso-opensso-plugin.iml
.settings
Property changes on: components/sso/trunk/opensso/gatein-opensso-portal
___________________________________________________________________
Modified: svn:ignore
- target
+ target
sso-opensso-pkg.iml
Property changes on: components/sso/trunk/saml/gatein-saml-plugin
___________________________________________________________________
Added: svn:ignore
+ sso-saml-plugin.iml
Property changes on: components/sso/trunk/spnego
___________________________________________________________________
Modified: svn:ignore
- target
*.iml
+ target
*.iml
.classpath
.project
.settings
12 years, 11 months
gatein SVN: r8334 - components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter.
by do-not-reply@jboss.org
Author: mposolda
Date: 2012-02-01 04:47:07 -0500 (Wed, 01 Feb 2012)
New Revision: 8334
Added:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter/PicketlinkSTSIntegrationFilter.java
Log:
GTNSSO-4 Filter for integration with PicketlinkSTS and adding SamlCredential into current securityContext
Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter/PicketlinkSTSIntegrationFilter.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter/PicketlinkSTSIntegrationFilter.java (rev 0)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter/PicketlinkSTSIntegrationFilter.java 2012-02-01 09:47:07 UTC (rev 8334)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2012, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.sso.agent.filter;
+
+import org.exoplatform.container.web.AbstractFilter;
+import org.exoplatform.services.security.jaas.UserPrincipal;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.jboss.security.SecurityContext;
+import org.jboss.security.SecurityContextAssociation;
+import org.jboss.security.client.SecurityClient;
+import org.jboss.security.client.SecurityClientFactory;
+import org.picketlink.identity.federation.core.wstrust.SamlCredential;
+
+import javax.security.auth.Subject;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Set;
+
+/**
+ * Filter for set {@link SamlCredential} into {@link SecurityClient}, which enables to propagate authentication from SAML2 ticket into
+ * underlying EJB or WS calls.
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+public class PicketlinkSTSIntegrationFilter extends AbstractFilter
+{
+ private static Logger log = LoggerFactory.getLogger(PicketlinkSTSIntegrationFilter.class);
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
+ {
+ HttpServletRequest httpRequest = (HttpServletRequest)request;
+ if (httpRequest.getRemoteUser() != null)
+ {
+ try
+ {
+ SamlCredential samlCredential = getSamlCredential();
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("Found SamlCredential inside Subject: " + samlCredential);
+ }
+
+ // Now set the security context, which can be used in EJB or other calls
+ if (samlCredential != null)
+ {
+ SecurityClient client = SecurityClientFactory.getSecurityClient();
+ // Simple login just updates the security context
+ client.setSimple(new UserPrincipal(httpRequest.getRemoteUser()), samlCredential);
+ client.login();
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("SecurityClient successfully updated with SAMLCredential");
+ }
+ }
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ chain.doFilter(request, response);
+ }
+
+ public void destroy()
+ {
+ }
+
+ private SamlCredential getSamlCredential()
+ {
+ Subject subj = getCurrentSubject();
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("Found subject " + subj);
+ }
+
+ if (subj == null)
+ {
+ return null;
+ }
+
+ Set<Object> credentials = subj.getPublicCredentials();
+ for (Object credential : credentials)
+ {
+ if (credential instanceof SamlCredential)
+ {
+ return (SamlCredential)credential;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * JBoss specific way for obtaining a Subject.
+ *
+ * @return subject
+ */
+ protected Subject getCurrentSubject()
+ {
+ SecurityContext securityContext = AccessController.doPrivileged(new PrivilegedAction<SecurityContext>()
+ {
+ public SecurityContext run()
+ {
+ return SecurityContextAssociation.getSecurityContext();
+ }
+ });
+ return securityContext.getSubjectInfo().getAuthenticatedSubject();
+ }
+}
12 years, 11 months
gatein SVN: r8333 - in portal/trunk/wsrp-integration: extension-ear-as5/src/main/application/lib/jboss5integration.jar/conf and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-02-01 04:32:15 -0500 (Wed, 01 Feb 2012)
New Revision: 8333
Added:
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/ConversationStateCredentialsAccessor.java
Modified:
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/JBoss5WSSServiceIntegration.java
portal/trunk/wsrp-integration/extension-ear-as5/src/main/application/lib/jboss5integration.jar/conf/configuration.xml
Log:
- GTNWSRP-268: applied patch from mposolda.
Added: portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/ConversationStateCredentialsAccessor.java
===================================================================
--- portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/ConversationStateCredentialsAccessor.java (rev 0)
+++ portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/ConversationStateCredentialsAccessor.java 2012-02-01 09:32:15 UTC (rev 8333)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2012, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.integration.wsrp.wss;
+
+import org.exoplatform.services.security.ConversationState;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.wci.security.Credentials;
+import org.gatein.wsrp.wss.credentials.CredentialsAccessor;
+
+/**
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+public class ConversationStateCredentialsAccessor implements CredentialsAccessor
+{
+
+ private static final Logger log = LoggerFactory.getLogger(ConversationStateCredentialsAccessor.class);
+
+ /**
+ * Reading credentials from @{link ConversationState} of current user.
+ *
+ * @return credentials
+ */
+ @Override
+ public Credentials getCredentials()
+ {
+ if (ConversationState.getCurrent() == null)
+ {
+ log.warn("Cannot find Credentials because ConversationState not set.");
+ return null;
+ }
+ return (Credentials)ConversationState.getCurrent().getAttribute(Credentials.CREDENTIALS);
+ }
+}
Modified: portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/JBoss5WSSServiceIntegration.java
===================================================================
--- portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/JBoss5WSSServiceIntegration.java 2012-02-01 09:19:20 UTC (rev 8332)
+++ portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/wss/JBoss5WSSServiceIntegration.java 2012-02-01 09:32:15 UTC (rev 8333)
@@ -23,6 +23,7 @@
package org.gatein.integration.wsrp.wss;
import org.gatein.wsrp.wss.WebServiceSecurityFactory;
+import org.gatein.wsrp.wss.credentials.CredentialsAccessor;
import org.picocontainer.Startable;
import org.wsrp.wss.jboss5.handlers.consumer.JBWSSecurityHandlerWrapper;
import org.wsrp.wss.jboss5.handlers.consumer.WSSecurityCredentialHandler;
@@ -35,12 +36,13 @@
{
private final WebServiceSecurityFactory wssFactory;
- private final WSSecurityCredentialHandler WS_CREDENTIAL_HANDLER = new WSSecurityCredentialHandler();
+ private final WSSecurityCredentialHandler WS_CREDENTIAL_HANDLER;
private final JBWSSecurityHandlerWrapper JBWS_SECURITY_WRAPPER = new JBWSSecurityHandlerWrapper();
- public JBoss5WSSServiceIntegration()
+ public JBoss5WSSServiceIntegration(CredentialsAccessor credentialsAccessor)
{
wssFactory = WebServiceSecurityFactory.getInstance();
+ WS_CREDENTIAL_HANDLER = new WSSecurityCredentialHandler(credentialsAccessor);
}
public void start()
Modified: portal/trunk/wsrp-integration/extension-ear-as5/src/main/application/lib/jboss5integration.jar/conf/configuration.xml
===================================================================
--- portal/trunk/wsrp-integration/extension-ear-as5/src/main/application/lib/jboss5integration.jar/conf/configuration.xml 2012-02-01 09:19:20 UTC (rev 8332)
+++ portal/trunk/wsrp-integration/extension-ear-as5/src/main/application/lib/jboss5integration.jar/conf/configuration.xml 2012-02-01 09:32:15 UTC (rev 8333)
@@ -28,6 +28,16 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
<component>
+ <key>org.gatein.wsrp.wss.credentials.CredentialsAccessor</key>
+
+ <!-- Reading credentials from HTTP session -->
+ <type>org.gatein.wsrp.wss.credentials.HTTPSessionCredentialsAccessor</type>
+
+ <!-- Reading credentials from ConversationState -->
+ <!--<type>org.gatein.integration.wsrp.wss.ConversationStateCredentialsAccessor</type>-->
+ </component>
+
+ <component>
<type>org.gatein.integration.wsrp.wss.JBoss5WSSServiceIntegration</type>
</component>
12 years, 11 months
gatein SVN: r8332 - in components/wsrp/trunk/ws-security: jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer and 2 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-02-01 04:19:20 -0500 (Wed, 01 Feb 2012)
New Revision: 8332
Added:
components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/
components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/CredentialsAccessor.java
components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/HTTPSessionCredentialsAccessor.java
Modified:
components/wsrp/trunk/ws-security/jboss5/pom.xml
components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/WSSecurityCredentialHandler.java
Log:
- GTNWSRP-268: Applied patch from mposolda to be able to retrieve credentials from other spots than HTTP session.
Modified: components/wsrp/trunk/ws-security/jboss5/pom.xml
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/pom.xml 2012-01-31 16:54:45 UTC (rev 8331)
+++ components/wsrp/trunk/ws-security/jboss5/pom.xml 2012-02-01 09:19:20 UTC (rev 8332)
@@ -1,6 +1,6 @@
<!--
~ JBoss, a division of Red Hat
- ~ Copyright 2011, Red Hat Middleware, LLC, and individual
+ ~ Copyright 2012, Red Hat Middleware, LLC, and individual
~ contributors as indicated by the @authors tag. See the
~ copyright.txt in the distribution for a full listing of
~ individual contributors.
@@ -46,6 +46,10 @@
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-wsrp2-ws</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wss</artifactId>
+ </dependency>
<dependency>
<groupId>org.gatein.common</groupId>
Modified: components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/WSSecurityCredentialHandler.java
===================================================================
--- components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/WSSecurityCredentialHandler.java 2012-01-31 16:54:45 UTC (rev 8331)
+++ components/wsrp/trunk/ws-security/jboss5/src/main/java/org/wsrp/wss/jboss5/handlers/consumer/WSSecurityCredentialHandler.java 2012-02-01 09:19:20 UTC (rev 8332)
@@ -1,42 +1,40 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2011, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2012, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.wsrp.wss.jboss5.handlers.consumer;
-import java.util.Set;
+import org.gatein.wci.security.Credentials;
+import org.gatein.wsrp.wss.credentials.CredentialsAccessor;
+import org.jboss.ws.core.CommonMessageContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import javax.servlet.http.HttpServletRequest;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.util.Set;
-import org.gatein.wci.security.Credentials;
-import org.gatein.wsrp.servlet.ServletAccess;
-import org.jboss.ws.core.CommonMessageContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
* @version $Revision$
@@ -45,6 +43,13 @@
{
private static Logger log = LoggerFactory.getLogger(WSSecurityCredentialHandler.class);
+ private CredentialsAccessor credentialsAccessor;
+
+ public WSSecurityCredentialHandler(CredentialsAccessor credentialsAccessor)
+ {
+ this.credentialsAccessor = credentialsAccessor;
+ }
+
public void close(MessageContext arg0)
{
//Nothing to do for now
@@ -74,26 +79,18 @@
log.debug("Attempting to convert security context to WS-Security header");
- CommonMessageContext ctx = (CommonMessageContext) soapMessageContext;
+ CommonMessageContext ctx = (CommonMessageContext)soapMessageContext;
- HttpServletRequest request = ServletAccess.getRequest();
- if (request != null && request.getSession() != null)
+ Credentials credentials = credentialsAccessor.getCredentials();
+
+ if (credentials != null)
{
- Credentials credentials = (Credentials)request.getSession().getAttribute(Credentials.CREDENTIALS);
- if (credentials != null)
- {
- ctx.put(BindingProvider.USERNAME_PROPERTY, credentials.getUsername());
- ctx.put(BindingProvider.PASSWORD_PROPERTY, credentials.getPassword());
- }
- else
- {
- log.debug("Could not find credentials to put in WS-Security header");
- return true;
- }
+ ctx.put(BindingProvider.USERNAME_PROPERTY, credentials.getUsername());
+ ctx.put(BindingProvider.PASSWORD_PROPERTY, credentials.getPassword());
}
else
{
- log.debug("Could not get current HttpServletRequest, cannot login.");
+ log.debug("Could not find credentials to put in WS-Security header");
}
}
catch (Exception e)
Added: components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/CredentialsAccessor.java
===================================================================
--- components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/CredentialsAccessor.java (rev 0)
+++ components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/CredentialsAccessor.java 2012-02-01 09:19:20 UTC (rev 8332)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2012, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp.wss.credentials;
+
+import org.gatein.wci.security.Credentials;
+
+/**
+ * Accessor for obtaining credentials of current user.
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+public interface CredentialsAccessor
+{
+
+ /** @return {@link org.gatein.wci.security.Credentials} of current user. */
+ public Credentials getCredentials();
+
+}
Added: components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/HTTPSessionCredentialsAccessor.java
===================================================================
--- components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/HTTPSessionCredentialsAccessor.java (rev 0)
+++ components/wsrp/trunk/ws-security/wss/src/main/java/org/gatein/wsrp/wss/credentials/HTTPSessionCredentialsAccessor.java 2012-02-01 09:19:20 UTC (rev 8332)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2012, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp.wss.credentials;
+
+import org.gatein.wci.security.Credentials;
+import org.gatein.wsrp.servlet.ServletAccess;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Obtaining credentials from HTTP session.
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+public class HTTPSessionCredentialsAccessor implements CredentialsAccessor
+{
+
+ private static Logger log = LoggerFactory.getLogger(HTTPSessionCredentialsAccessor.class);
+
+ /**
+ * Return credentials from HTTP session. It assumes that Credentials are in HTTP session in attribute
+ * {@link org.gatein.wci.security.Credentials#CREDENTIALS} and current HTTP request is bound to {@link
+ * org.gatein.wsrp.servlet.ServletAccess} thread-local.
+ *
+ * @return credentials
+ */
+ @Override
+ public Credentials getCredentials()
+ {
+ HttpServletRequest request = ServletAccess.getRequest();
+ if (request != null && request.getSession() != null)
+ {
+ return (Credentials)request.getSession().getAttribute(Credentials.CREDENTIALS);
+ }
+ else
+ {
+ log.debug("Could not get current HttpServletRequest, cannot obtain credentials from HTTP session.");
+ return null;
+ }
+ }
+}
12 years, 11 months