Author: richard.opalka(a)jboss.com
Date: 2009-02-13 18:08:07 -0500 (Fri, 13 Feb 2009)
New Revision: 9311
Modified:
container/jboss50/branches/jboss501/pom.xml
container/jboss50/branches/jboss501/src/main/java/org/jboss/wsf/container/jboss50/invocation/SecurityAdaptorImpl.java
Log:
[JBWS-1999] WS-Security, authentication and authorization for POJO endpoints - Testsuite
fixes
Modified: container/jboss50/branches/jboss501/pom.xml
===================================================================
--- container/jboss50/branches/jboss501/pom.xml 2009-02-13 22:40:46 UTC (rev 9310)
+++ container/jboss50/branches/jboss501/pom.xml 2009-02-13 23:08:07 UTC (rev 9311)
@@ -24,8 +24,8 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.0.8.GA</jbossws.common.version>
- <jbossws.spi.version>1.0.7.GA</jbossws.spi.version>
+ <jbossws.common.version>1.0.9-SNAPSHOT</jbossws.common.version>
+ <jbossws.spi.version>1.1.0-SNAPSHOT</jbossws.spi.version>
<!--
JBoss component versions taken from
Modified:
container/jboss50/branches/jboss501/src/main/java/org/jboss/wsf/container/jboss50/invocation/SecurityAdaptorImpl.java
===================================================================
---
container/jboss50/branches/jboss501/src/main/java/org/jboss/wsf/container/jboss50/invocation/SecurityAdaptorImpl.java 2009-02-13
22:40:46 UTC (rev 9310)
+++
container/jboss50/branches/jboss501/src/main/java/org/jboss/wsf/container/jboss50/invocation/SecurityAdaptorImpl.java 2009-02-13
23:08:07 UTC (rev 9311)
@@ -22,10 +22,16 @@
package org.jboss.wsf.container.jboss50.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