Author: asoldano
Date: 2014-04-30 05:29:18 -0400 (Wed, 30 Apr 2014)
New Revision: 18602
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java
Removed:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AutenticationMgrSubjectCreatingInterceptor.java
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
Log:
Fixing classname typo
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-04-30
08:19:25 UTC (rev 18601)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-04-30
09:29:18 UTC (rev 18602)
@@ -67,7 +67,7 @@
import org.jboss.wsf.stack.cxf.interceptor.HandlerAuthInterceptor;
import org.jboss.wsf.stack.cxf.interceptor.NsCtxSelectorStoreInterceptor;
import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
-import
org.jboss.wsf.stack.cxf.security.authentication.AutenticationMgrSubjectCreatingInterceptor;
+import
org.jboss.wsf.stack.cxf.security.authentication.AuthenticationMgrSubjectCreatingInterceptor;
/**
* A wrapper of the Bus for performing most of the configurations required on it by
JBossWS
@@ -127,7 +127,7 @@
if (jaspiProvider != null &&
jaspiProvider.enableServerAuthentication(dep, wsmd))
{
- bus.getInInterceptors().add(new
AutenticationMgrSubjectCreatingInterceptor());
+ bus.getInInterceptors().add(new
AuthenticationMgrSubjectCreatingInterceptor());
}
}
catch (WSFException e)
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-04-30
08:19:25 UTC (rev 18601)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-04-30
09:29:18 UTC (rev 18602)
@@ -44,7 +44,7 @@
import org.jboss.wsf.stack.cxf.client.configuration.BeanCustomizer;
import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
-import
org.jboss.wsf.stack.cxf.security.authentication.AutenticationMgrSubjectCreatingInterceptor;
+import
org.jboss.wsf.stack.cxf.security.authentication.AuthenticationMgrSubjectCreatingInterceptor;
import org.jboss.wsf.stack.cxf.transport.JBossWSDestinationRegistryImpl;
/**
@@ -183,7 +183,7 @@
{
if (jaspiProvider.enableServerAuthentication(endpoint, depEndpoints.get(0)))
{
- endpoint.getInInterceptors().add(new
AutenticationMgrSubjectCreatingInterceptor());
+ endpoint.getInInterceptors().add(new
AuthenticationMgrSubjectCreatingInterceptor());
}
}
}
Deleted:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AutenticationMgrSubjectCreatingInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AutenticationMgrSubjectCreatingInterceptor.java 2014-04-30
08:19:25 UTC (rev 18601)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AutenticationMgrSubjectCreatingInterceptor.java 2014-04-30
09:29:18 UTC (rev 18602)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jboss.wsf.stack.cxf.security.authentication;
-
-import java.security.Principal;
-
-import javax.security.auth.Subject;
-
-import org.apache.cxf.common.security.SecurityToken;
-import org.apache.cxf.common.security.TokenType;
-import org.apache.cxf.common.security.UsernameToken;
-import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.message.Message;
-import org.apache.cxf.security.SecurityContext;
-import org.apache.wss4j.common.principal.UsernameTokenPrincipal;
-import org.jboss.security.plugins.JBossAuthenticationManager;
-import org.jboss.wsf.stack.cxf.Loggers;
-import org.jboss.wsf.stack.cxf.Messages;
-
-/**
- * Interceptor to authenticate principal with provided jaspi JBossAuthenticationManager
- * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
- */
-public class AutenticationMgrSubjectCreatingInterceptor extends
SubjectCreatingPolicyInterceptor
-{
-
- public AutenticationMgrSubjectCreatingInterceptor() {
- super();
- }
-
-
- @Override
- public void handleMessage(Message message) throws Fault
- {
- JBossAuthenticationManager authenticationManger =
message.get(JBossAuthenticationManager.class);
- if (authenticationManger == null) {
- return;
- }
- SecurityContext context = message.get(SecurityContext.class);
- if (context == null || context.getUserPrincipal() == null)
- {
- Loggers.SECURITY_LOGGER.userPrincipalNotAvailableOnCurrentMessage();
- return;
- }
-
- SecurityToken token = message.get(SecurityToken.class);
- Subject subject = null;
- if (token != null)
- {
- //Try authenticating using SecurityToken info
- if (token.getTokenType() != TokenType.UsernameToken)
- {
- throw Messages.MESSAGES.unsupportedTokenType(token.getTokenType());
- }
- UsernameToken ut = (UsernameToken) token;
- subject = helper.createSubject(authenticationManger, ut.getName(),
ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime());
-
- }
- else
- {
- //Try authenticating using WSS4J internal info (previously set into
SecurityContext by WSS4JInInterceptor)
- Principal p = context.getUserPrincipal();
- if (!(p instanceof UsernameTokenPrincipal)) {
- throw Messages.MESSAGES.couldNotGetSubjectInfo();
- }
- UsernameTokenPrincipal up = (UsernameTokenPrincipal) p;
- subject = helper.createSubject(authenticationManger, up.getName(),
up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime());
- }
-
- Principal principal = getPrincipal(context.getUserPrincipal(), subject);
- message.put(SecurityContext.class, createSecurityContext(principal, subject));
- }
-
-
-}
Added:
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
(rev 0)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java 2014-04-30
09:29:18 UTC (rev 18602)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.wsf.stack.cxf.security.authentication;
+
+import java.security.Principal;
+
+import javax.security.auth.Subject;
+
+import org.apache.cxf.common.security.SecurityToken;
+import org.apache.cxf.common.security.TokenType;
+import org.apache.cxf.common.security.UsernameToken;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.security.SecurityContext;
+import org.apache.wss4j.common.principal.UsernameTokenPrincipal;
+import org.jboss.security.plugins.JBossAuthenticationManager;
+import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.Messages;
+
+/**
+ * Interceptor to authenticate principal with provided jaspi JBossAuthenticationManager
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ */
+public class AuthenticationMgrSubjectCreatingInterceptor extends
SubjectCreatingPolicyInterceptor
+{
+
+ public AuthenticationMgrSubjectCreatingInterceptor() {
+ super();
+ }
+
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+ JBossAuthenticationManager authenticationManger =
message.get(JBossAuthenticationManager.class);
+ if (authenticationManger == null) {
+ return;
+ }
+ SecurityContext context = message.get(SecurityContext.class);
+ if (context == null || context.getUserPrincipal() == null)
+ {
+ Loggers.SECURITY_LOGGER.userPrincipalNotAvailableOnCurrentMessage();
+ return;
+ }
+
+ SecurityToken token = message.get(SecurityToken.class);
+ Subject subject = null;
+ if (token != null)
+ {
+ //Try authenticating using SecurityToken info
+ if (token.getTokenType() != TokenType.UsernameToken)
+ {
+ throw Messages.MESSAGES.unsupportedTokenType(token.getTokenType());
+ }
+ UsernameToken ut = (UsernameToken) token;
+ subject = helper.createSubject(authenticationManger, ut.getName(),
ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime());
+
+ }
+ else
+ {
+ //Try authenticating using WSS4J internal info (previously set into
SecurityContext by WSS4JInInterceptor)
+ Principal p = context.getUserPrincipal();
+ if (!(p instanceof UsernameTokenPrincipal)) {
+ throw Messages.MESSAGES.couldNotGetSubjectInfo();
+ }
+ UsernameTokenPrincipal up = (UsernameTokenPrincipal) p;
+ subject = helper.createSubject(authenticationManger, up.getName(),
up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime());
+ }
+
+ Principal principal = getPrincipal(context.getUserPrincipal(), subject);
+ message.put(SecurityContext.class, createSecurityContext(principal, subject));
+ }
+
+
+}
Property changes on:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationMgrSubjectCreatingInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native