Author: darran.lofthouse(a)jboss.com
Date: 2009-01-13 11:39:11 -0500 (Tue, 13 Jan 2009)
New Revision: 9021
Modified:
container/jboss60/trunk/pom.xml
container/jboss60/trunk/src/main/java/org/jboss/wsf/container/jboss60/invocation/SecurityAdaptorImpl.java
Log:
[JBWS-1999] WS-Security, authentication and authorization for POJO endpoints - Testsuite
fixes.
Modified: container/jboss60/trunk/pom.xml
===================================================================
--- container/jboss60/trunk/pom.xml 2009-01-13 16:38:55 UTC (rev 9020)
+++ container/jboss60/trunk/pom.xml 2009-01-13 16:39:11 UTC (rev 9021)
@@ -25,7 +25,7 @@
<!-- Properties -->
<properties>
<jbossws.common.version>1.0.8.GA</jbossws.common.version>
- <jbossws.spi.version>1.0.7.GA</jbossws.spi.version>
+ <jbossws.spi.version>1.0.8-SNAPSHOT</jbossws.spi.version>
<jboss.version>6.0.0-SNAPSHOT</jboss.version>
<jboss.ejb3.version>1.0.0-Beta11</jboss.ejb3.version>
Modified:
container/jboss60/trunk/src/main/java/org/jboss/wsf/container/jboss60/invocation/SecurityAdaptorImpl.java
===================================================================
---
container/jboss60/trunk/src/main/java/org/jboss/wsf/container/jboss60/invocation/SecurityAdaptorImpl.java 2009-01-13
16:38:55 UTC (rev 9020)
+++
container/jboss60/trunk/src/main/java/org/jboss/wsf/container/jboss60/invocation/SecurityAdaptorImpl.java 2009-01-13
16:39:11 UTC (rev 9021)
@@ -22,10 +22,16 @@
package org.jboss.wsf.container.jboss60.invocation;
import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SecurityContext;
+import org.jboss.security.SecurityContextAssociation;
import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import java.security.AccessController;
import java.security.Principal;
+import java.security.PrivilegedAction;
+import javax.security.auth.Subject;
+
/**
* A JBoss specific SecurityAssociationAdaptor
*
@@ -57,4 +63,34 @@
{
SecurityAssociation.setCredential(credential);
}
+
+ public void pushSubjectContext(Subject subject, Principal principal, Object
credential)
+ {
+ SecurityAdaptorImpl.pushSubjectContext(principal, credential, subject);
+ }
+
+ private static SecurityContext getSecurityContext()
+ {
+ return (SecurityContext)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run()
+ {
+ return SecurityContextAssociation.getSecurityContext();
+ }
+ });
+ }
+
+ private static void pushSubjectContext(final Principal p, final Object cred, final
Subject s)
+ {
+ AccessController.doPrivileged(new PrivilegedAction() {
+
+ public Object run()
+ {
+ SecurityContext sc = getSecurityContext();
+ if (sc == null)
+ throw new IllegalStateException("Security Context is null");
+ sc.getUtil().createSubjectInfo(p, cred, s);
+ return null;
+ }
+ });
+ }
}
Show replies by date