Author: jim.ma
Date: 2015-06-17 06:08:03 -0400 (Wed, 17 Jun 2015)
New Revision: 19796
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
Log:
[JBWS-3916]:Remove the workaround for JBWS-3843
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java 2015-06-17
08:28:00 UTC (rev 19795)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java 2015-06-17
10:08:03 UTC (rev 19796)
@@ -137,28 +137,7 @@
{
throw Messages.MESSAGES.missingBindingOpeartionAndDispatchedMethod();
}
-
- //[JBWS-3843] workaround: set the CallbackHandler threadlocal again; as a matter of
fact, if that's in the Exchange,
- //DIGEST auth is being used and that will cause the EJB layer to re-do
authentication because of the bug
- CallbackHandler cbHandler = exchange.getInMessage().get(CallbackHandler.class);
- Object obj = null;
- try
- {
- if (cbHandler != null)
- {
- CallbackHandlerPolicyContextHandler.setCallbackHandler(cbHandler);
- }
- obj = invoke(exchange, targetBean,
- adjustMethodAndParams(method, exchange, params, targetBean.getClass()),
params);
- }
- finally
- {
- if (cbHandler != null)
- {
- CallbackHandlerPolicyContextHandler.setCallbackHandler(null);
- }
- }
- return obj;
+ return invoke(exchange, targetBean, adjustMethodAndParams(md.getMethod(bop),
exchange, params, targetBean.getClass()), params);
}
/**
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java 2015-06-17
08:28:00 UTC (rev 19795)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java 2015-06-17
10:08:03 UTC (rev 19796)
@@ -72,7 +72,7 @@
throw Messages.MESSAGES.unsupportedTokenType(token.getTokenType());
}
UsernameToken ut = (UsernameToken) token;
- subject = helper.createSubject(authenticationManger, ut.getName(),
ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime(), message);
+ subject = helper.createSubject(authenticationManger, ut.getName(),
ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime());
}
else
@@ -83,7 +83,7 @@
throw Messages.MESSAGES.couldNotGetSubjectInfo();
}
UsernameTokenPrincipal up = (UsernameTokenPrincipal) p;
- subject = helper.createSubject(authenticationManger, up.getName(),
up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime(), message);
+ subject = helper.createSubject(authenticationManger, up.getName(),
up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime());
}
Principal principal = getPrincipal(context.getUserPrincipal(), subject);
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2015-06-17
08:28:00 UTC (rev 19795)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2015-06-17
10:08:03 UTC (rev 19796)
@@ -104,7 +104,7 @@
UsernameToken ut = (UsernameToken)token;
Subject subject = createSubject(ut.getName(), ut.getPassword(), ut.isHashed(),
- ut.getNonce(), ut.getCreatedTime(), msg);
+ ut.getNonce(), ut.getCreatedTime());
SecurityContext sc = doCreateSecurityContext(context.getUserPrincipal(),
subject);
msg.put(SecurityContext.class, sc);
@@ -152,7 +152,7 @@
Subject subject = null;
try
{
- subject = createSubject(name, password, isDigest, nonce, created, msg);
+ subject = createSubject(name, password, isDigest, nonce, created);
}
catch (Exception ex)
{
@@ -240,9 +240,9 @@
}
- public Subject createSubject(String name, String password, boolean isDigest, String
nonce, String created, Message msg)
+ public Subject createSubject(String name, String password, boolean isDigest, String
nonce, String created)
{
- return helper.createSubject(sdc.get(), name, password, isDigest, nonce, created,
msg);
+ return helper.createSubject(sdc.get(), name, password, isDigest, nonce, created);
}
public void setPropagateContext(boolean propagateContext)
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2015-06-17
08:28:00 UTC (rev 19795)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2015-06-17
10:08:03 UTC (rev 19796)
@@ -88,7 +88,7 @@
throw Messages.MESSAGES.unsupportedTokenType(token.getTokenType());
}
UsernameToken ut = (UsernameToken) token;
- subject = createSubject(sdc, ut.getName(), ut.getPassword(), ut.isHashed(),
ut.getNonce(), ut.getCreatedTime(), message);
+ subject = createSubject(sdc, ut.getName(), ut.getPassword(), ut.isHashed(),
ut.getNonce(), ut.getCreatedTime());
}
else
@@ -99,19 +99,19 @@
throw Messages.MESSAGES.couldNotGetSubjectInfo();
}
UsernameTokenPrincipal up = (UsernameTokenPrincipal) p;
- subject = createSubject(sdc, up.getName(), up.getPassword(),
up.isPasswordDigest(), up.getNonce(), up.getCreatedTime(), message);
+ subject = createSubject(sdc, up.getName(), up.getPassword(),
up.isPasswordDigest(), up.getNonce(), up.getCreatedTime());
}
Principal principal = getPrincipal(context.getUserPrincipal(), subject);
message.put(SecurityContext.class, createSecurityContext(principal, subject));
}
- protected Subject createSubject(SecurityDomainContext sdc, String name, String
password, boolean isDigest, String nonce, String creationTime, Message msg)
+ protected Subject createSubject(SecurityDomainContext sdc, String name, String
password, boolean isDigest, String nonce, String creationTime)
{
Subject subject = null;
try
{
- subject = helper.createSubject(sdc, name, password, isDigest, nonce,
creationTime, msg);
+ subject = helper.createSubject(sdc, name, password, isDigest, nonce,
creationTime);
}
catch (Exception ex)
{
@@ -124,12 +124,12 @@
return subject;
}
- protected Subject createSubject(SecurityDomainContext sdc, String name, String
password, boolean isDigest, byte[] nonce, String creationTime, Message msg)
+ protected Subject createSubject(SecurityDomainContext sdc, String name, String
password, boolean isDigest, byte[] nonce, String creationTime)
{
Subject subject = null;
try
{
- subject = helper.createSubject(sdc, name, password, isDigest, nonce,
creationTime, msg);
+ subject = helper.createSubject(sdc, name, password, isDigest, nonce,
creationTime);
}
catch (Exception ex)
{
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2015-06-17
08:28:00 UTC (rev 19795)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2015-06-17
10:08:03 UTC (rev 19796)
@@ -35,7 +35,6 @@
import javax.security.auth.callback.CallbackHandler;
import org.apache.cxf.common.security.SimplePrincipal;
-import org.apache.cxf.message.Message;
import org.jboss.security.auth.callback.CallbackHandlerPolicyContextHandler;
import org.jboss.security.plugins.JBossAuthenticationManager;
import org.jboss.ws.common.utils.DelegateClassLoader;
@@ -64,14 +63,14 @@
private boolean decodeNonce = true;
- public Subject createSubject(SecurityDomainContext ctx, String name, String password,
boolean isDigest, byte[] nonce, String created, Message msg)
+ public Subject createSubject(SecurityDomainContext ctx, String name, String password,
boolean isDigest, byte[] nonce, String created)
{
//TODO, revisit
final String sNonce = convertNonce(nonce);
- return createSubject(ctx, name, password, isDigest, sNonce, created, msg);
+ return createSubject(ctx, name, password, isDigest, sNonce, created);
}
- public Subject createSubject(SecurityDomainContext ctx, String name, String password,
boolean isDigest, String nonce, String created, Message msg)
+ public Subject createSubject(SecurityDomainContext ctx, String name, String password,
boolean isDigest, String nonce, String created)
{
if (isDigest)
{
@@ -84,7 +83,6 @@
CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created,
decodeNonce);
CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
- msg.put(CallbackHandler.class, handler);
}
// authenticate and populate Subject
@@ -135,14 +133,14 @@
}
return subject;
}
- public Subject createSubject(JBossAuthenticationManager manager, String name, String
password, boolean isDigest, byte[] nonce, String created, Message msg)
+ public Subject createSubject(JBossAuthenticationManager manager, String name, String
password, boolean isDigest, byte[] nonce, String created)
{
//TODO revisit
final String sNonce = convertNonce(nonce);
- return createSubject(manager, name, password, isDigest, sNonce, created, msg);
+ return createSubject(manager, name, password, isDigest, sNonce, created);
}
//TODO:refactor this
- public Subject createSubject(JBossAuthenticationManager manager, String name, String
password, boolean isDigest, String nonce, String created, Message msg)
+ public Subject createSubject(JBossAuthenticationManager manager, String name, String
password, boolean isDigest, String nonce, String created)
{
if (isDigest)
{
@@ -155,7 +153,6 @@
CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created,
decodeNonce);
CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
- msg.put(CallbackHandler.class, handler);
}
// authenticate and populate Subject