You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2014/12/01 17:10:19 UTC

[5/6] cxf git commit: Added a new "kerberos" system module for integration testing using the Apache DS KDC

Added a new "kerberos" system module for integration testing using the Apache DS KDC


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0d19ce6a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0d19ce6a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0d19ce6a

Branch: refs/heads/3.0.x-fixes
Commit: 0d19ce6ae178b3baa850483b4243f5bc6f4886b8
Parents: dd56dc9
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Mon Dec 1 14:38:01 2014 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Dec 1 15:31:32 2014 +0000

----------------------------------------------------------------------
 parent/pom.xml                                  |    1 +
 .../ws/security/wss4j/WSS4JInInterceptor.java   |   18 +-
 systests/kerberos/pom.xml                       |  278 +++++
 .../systest/kerberos/common/DoubleItImpl.java   |   40 +
 .../kerberos/common/DoubleItPortTypeImpl.java   |   50 +
 .../common/KerberosClientPasswordCallback.java  |   48 +
 .../common/KerberosServicePasswordCallback.java |   60 +
 .../common/KeystorePasswordCallback.java        |   72 ++
 .../kerberos/common/SecurityTestUtil.java       |   91 ++
 .../wssec/kerberos/KerberosTokenTest.java       |  419 +++++++
 .../systest/kerberos/wssec/kerberos/Server.java |   47 +
 .../kerberos/wssec/kerberos/StaxServer.java     |   47 +
 systests/kerberos/src/test/resources/Bethal.jks |  Bin 0 -> 1317 bytes
 .../src/test/resources/DoubleItLogical.wsdl     |  142 +++
 systests/kerberos/src/test/resources/Morpit.jks |  Bin 0 -> 1337 bytes
 .../kerberos/src/test/resources/Truststore.jks  |  Bin 0 -> 2942 bytes
 systests/kerberos/src/test/resources/alice.jks  |  Bin 0 -> 2428 bytes
 .../src/test/resources/alice.properties         |   21 +
 systests/kerberos/src/test/resources/bob.jks    |  Bin 0 -> 2422 bytes
 .../kerberos/src/test/resources/bob.properties  |   21 +
 .../kerberos/src/test/resources/kerberos.jaas   |    8 +
 .../kerberos/src/test/resources/kerberos.ldif   |   51 +
 systests/kerberos/src/test/resources/krb5.conf  |    7 +
 .../src/test/resources/logging.properties       |   74 ++
 .../wssec/kerberos/DoubleItKerberos.wsdl        | 1028 ++++++++++++++++++
 .../systest/kerberos/wssec/kerberos/client.xml  |  256 +++++
 .../systest/kerberos/wssec/kerberos/server.xml  |  181 +++
 .../kerberos/wssec/kerberos/stax-server.xml     |  166 +++
 systests/pom.xml                                |    1 +
 .../ws/kerberos/KerberosPasswordCallback.java   |   64 --
 .../systest/ws/kerberos/KerberosTokenTest.java  |  590 ----------
 .../apache/cxf/systest/ws/kerberos/Server.java  |   47 -
 .../cxf/systest/ws/kerberos/StaxServer.java     |   47 -
 .../systest/ws/kerberos/DoubleItKerberos.wsdl   | 1028 ------------------
 .../apache/cxf/systest/ws/kerberos/client.xml   |  237 ----
 .../apache/cxf/systest/ws/kerberos/server.xml   |  174 ---
 .../cxf/systest/ws/kerberos/stax-server.xml     |  164 ---
 37 files changed, 3119 insertions(+), 2359 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 5693e99..f96e801 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -75,6 +75,7 @@
         <cxf.abdera.version>1.1.3</cxf.abdera.version>
         <cxf.activemq.version>5.9.1</cxf.activemq.version>
         <cxf.ahc.version>1.8.5</cxf.ahc.version>
+        <cxf.apacheds.version>2.0.0-M19</cxf.apacheds.version>
         <cxf.atmosphere.version>2.2.0</cxf.atmosphere.version>
         <cxf.atmosphere.version.range>[2.0,3.0)</cxf.atmosphere.version.range>
         <cxf.axiom.version>1.2.14</cxf.axiom.version>

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
index 98650fb..4fec350 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
@@ -675,14 +675,16 @@ public class WSS4JInInterceptor extends AbstractWSS4JInterceptor {
         
         public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
             for (int i = 0; i < callbacks.length; i++) {
-                WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
-                
-                String id = pc.getIdentifier();
-                SecurityToken tok = store.getToken(id);
-                if (tok != null && !tok.isExpired()) {
-                    pc.setKey(tok.getSecret());
-                    pc.setCustomToken(tok.getToken());
-                    return;
+                if (callbacks[i] instanceof WSPasswordCallback) {
+                    WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+                    
+                    String id = pc.getIdentifier();
+                    SecurityToken tok = store.getToken(id);
+                    if (tok != null && !tok.isExpired()) {
+                        pc.setKey(tok.getSecret());
+                        pc.setCustomToken(tok.getToken());
+                        return;
+                    }
                 }
             }
             if (internal != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/pom.xml
----------------------------------------------------------------------
diff --git a/systests/kerberos/pom.xml b/systests/kerberos/pom.xml
new file mode 100644
index 0000000..2aedb2d
--- /dev/null
+++ b/systests/kerberos/pom.xml
@@ -0,0 +1,278 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<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>
+        <artifactId>cxf-parent</artifactId>
+        <groupId>org.apache.cxf</groupId>
+        <version>3.1.0-SNAPSHOT</version>
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf.systests</groupId>
+    <artifactId>cxf-systests-kerberos</artifactId>
+    <name>Apache CXF Kerberos Integration System Tests</name>
+    <description>Apache CXF Kerberos Integration System Tests</description>
+    <url>http://cxf.apache.org</url>
+    <build>
+        <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
+        <testResources>
+            <testResource>
+                <directory>src/test/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </testResource>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <includes>
+                    <include>**/*</include>
+                </includes>
+            </testResource>
+        </testResources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-codegen-plugin</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <fork>${cxf.codegenplugin.forkmode}</fork>
+                            <sourceRoot>${basedir}/target/generated-sources</sourceRoot>
+                            <defaultOptions>
+                                <markGenerated>true</markGenerated>
+                                <faultSerialVersionUID>1</faultSerialVersionUID>
+                            </defaultOptions>
+                            <wsdlOptions>
+                                <wsdlOption>
+                                    <wsdl>${basedir}/src/test/resources/DoubleItLogical.wsdl</wsdl>
+                                </wsdlOption>
+                            </wsdlOptions>
+                        </configuration>
+                        <goals>
+                            <goal>wsdl2java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-databinding-jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-bindings-soap</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http-jetty</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-ws-addr</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-ws-policy</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-ws-security</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${cxf.asm.groupId}</groupId>
+            <artifactId>${cxf.asm.artifactId}</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.xml.fastinfoset</groupId>
+            <artifactId>FastInfoset</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15on</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-core-annotations</artifactId>
+            <version>${cxf.apacheds.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>bouncycastle</groupId>
+                    <artifactId>bcprov-jdk15</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-core-integ</artifactId>
+            <version>${cxf.apacheds.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>bouncycastle</groupId>
+                    <artifactId>bcprov-jdk15</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-protocol-shared</artifactId>
+            <version>${cxf.apacheds.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>bouncycastle</groupId>
+                    <artifactId>bcprov-jdk15</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-protocol-kerberos</artifactId>
+            <version>${cxf.apacheds.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>bouncycastle</groupId>
+                    <artifactId>bcprov-jdk15</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>net.sf.ehcache</groupId>
+                    <artifactId>ehcache-core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-interceptor-kerberos</artifactId>
+            <version>${cxf.apacheds.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>bouncycastle</groupId>
+                    <artifactId>bcprov-jdk15</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-kerberos-codec</artifactId>
+            <version>${cxf.apacheds.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>net.sf.ehcache</groupId>
+                    <artifactId>ehcache-core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+            <id>async</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.cxf</groupId>
+                    <artifactId>cxf-rt-transports-http-hc</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/DoubleItImpl.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/DoubleItImpl.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/DoubleItImpl.java
new file mode 100644
index 0000000..a4dfc2c
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/DoubleItImpl.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.kerberos.common;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.feature.Features;
+import org.example.contract.doubleit.DoubleItFault;
+import org.example.contract.doubleit.DoubleItPortType;
+
+@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt", 
+            serviceName = "DoubleItService", 
+            endpointInterface = "org.example.contract.doubleit.DoubleItPortType")
+@Features(features = "org.apache.cxf.feature.LoggingFeature")              
+public class DoubleItImpl implements DoubleItPortType {
+    
+    public int doubleIt(int numberToDouble) throws DoubleItFault {
+        if (numberToDouble == 0) {
+            throw new DoubleItFault("0 can't be doubled!");
+        }
+        return numberToDouble * 2;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/DoubleItPortTypeImpl.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/DoubleItPortTypeImpl.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/DoubleItPortTypeImpl.java
new file mode 100644
index 0000000..ed08796
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/DoubleItPortTypeImpl.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.kerberos.common;
+
+import java.security.Principal;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.feature.Features;
+import org.example.contract.doubleit.DoubleItFault;
+import org.example.contract.doubleit.DoubleItPortType;
+import org.junit.Assert;
+
+@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt", 
+            serviceName = "DoubleItService", 
+            endpointInterface = "org.example.contract.doubleit.DoubleItPortType")
+@Features(features = "org.apache.cxf.feature.LoggingFeature")              
+public class DoubleItPortTypeImpl implements DoubleItPortType {
+    
+    @Resource
+    WebServiceContext wsContext;
+
+    public int doubleIt(int numberToDouble) throws DoubleItFault  {
+        Principal pr = wsContext.getUserPrincipal();
+        
+        Assert.assertNotNull("Principal must not be null", pr);
+        Assert.assertNotNull("Principal.getName() must not return null", pr.getName());
+        
+        return numberToDouble * 2;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KerberosClientPasswordCallback.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KerberosClientPasswordCallback.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KerberosClientPasswordCallback.java
new file mode 100644
index 0000000..754686a
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KerberosClientPasswordCallback.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.kerberos.common;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+/**
+ * A CallbackHandler implementation for the kerberos client.
+ */
+public class KerberosClientPasswordCallback implements CallbackHandler {
+    
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            if (callbacks[i] instanceof NameCallback) {
+                NameCallback nameCallback = (NameCallback)callbacks[i];
+                nameCallback.setName("alice");
+            } else if (callbacks[i] instanceof PasswordCallback) {
+                PasswordCallback passwordCallback = (PasswordCallback)callbacks[i];
+                passwordCallback.setPassword("alice".toCharArray());
+            }
+        }
+    }
+    
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KerberosServicePasswordCallback.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KerberosServicePasswordCallback.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KerberosServicePasswordCallback.java
new file mode 100644
index 0000000..d43d39c
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KerberosServicePasswordCallback.java
@@ -0,0 +1,60 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.kerberos.common;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+import org.apache.wss4j.common.kerberos.KerberosContextAndServiceNameCallback;
+
+/**
+ *  A CallbackHandler implementation for the kerberos service.
+ */
+public class KerberosServicePasswordCallback extends KeystorePasswordCallback {
+    
+    public KerberosServicePasswordCallback() {
+    }
+
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            if (callbacks[i] instanceof WSPasswordCallback) {
+                super.handle(new Callback[]{callbacks[i]});
+            } else if (callbacks[i] instanceof KerberosContextAndServiceNameCallback) {
+                KerberosContextAndServiceNameCallback pc = 
+                    (KerberosContextAndServiceNameCallback)callbacks[i];
+                pc.setContextName("bob");
+                pc.setServiceName("bob@service.ws.apache.org");
+            } else if (callbacks[i] instanceof NameCallback) {
+                NameCallback nameCallback = (NameCallback)callbacks[i];
+                nameCallback.setName("bob");
+            } else if (callbacks[i] instanceof PasswordCallback) {
+                PasswordCallback passwordCallback = (PasswordCallback)callbacks[i];
+                passwordCallback.setPassword("bob".toCharArray());
+            }
+        }
+    }
+    
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java
new file mode 100644
index 0000000..0bada6a
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.kerberos.common;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
+/**
+ * A CallbackHandler implementation for keystores.
+ */
+public class KeystorePasswordCallback implements CallbackHandler {
+    
+    private Map<String, String> passwords = 
+        new HashMap<String, String>();
+    
+    public KeystorePasswordCallback() {
+        passwords.put("Alice", "abcd!1234");
+        passwords.put("alice", "password");
+        passwords.put("Bob", "abcd!1234");
+        passwords.put("bob", "password");
+        passwords.put("abcd", "dcba");
+        passwords.put("6e0e88f36ebb8744d470f62f604d03ea4ebe5094", "password");
+        passwords.put("wss40rev", "security");
+    }
+
+    /**
+     * It attempts to get the password from the private 
+     * alias/passwords map.
+     */
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+            if (pc.getUsage() == WSPasswordCallback.PASSWORD_ENCRYPTOR_PASSWORD) {
+                pc.setPassword("this-is-a-secret");
+            } else {
+                String pass = passwords.get(pc.getIdentifier());
+                if (pass != null) {
+                    pc.setPassword(pass);
+                    return;
+                } else {
+                    pc.setPassword("password");
+                }
+            }
+        }
+    }
+    
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/SecurityTestUtil.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/SecurityTestUtil.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/SecurityTestUtil.java
new file mode 100644
index 0000000..d2af280
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/SecurityTestUtil.java
@@ -0,0 +1,91 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.kerberos.common;
+
+import java.io.File;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import javax.xml.ws.BindingProvider;
+
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.example.contract.doubleit.DoubleItPortType;
+
+/**
+ * A utility class for security tests
+ */
+public final class SecurityTestUtil {
+    
+    private static final boolean UNRESTRICTED_POLICIES_INSTALLED;
+    static {
+        boolean ok = false;
+        try {
+            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
+
+            SecretKey key192 = new SecretKeySpec(
+                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
+                            "AES");
+            Cipher c = Cipher.getInstance("AES");
+            c.init(Cipher.ENCRYPT_MODE, key192);
+            c.doFinal(data);
+            ok = true;
+        } catch (Exception e) {
+            //
+        }
+        UNRESTRICTED_POLICIES_INSTALLED = ok;
+    }
+    
+    private SecurityTestUtil() {
+        // complete
+    }
+    
+    public static void cleanup() {
+        String tmpDir = System.getProperty("java.io.tmpdir");
+        if (tmpDir != null) {
+            File[] tmpFiles = new File(tmpDir).listFiles();
+            if (tmpFiles != null) {
+                for (File tmpFile : tmpFiles) {
+                    if (tmpFile.exists() && (tmpFile.getName().startsWith("ws-security.nonce.cache")
+                            || tmpFile.getName().startsWith("wss4j-nonce-cache")
+                            || tmpFile.getName().startsWith("ws-security.timestamp.cache")
+                            || tmpFile.getName().startsWith("wss4j-timestamp-cache"))) {
+                        tmpFile.delete();
+                    }
+                }
+            }
+        }
+    }
+    
+    public static boolean checkUnrestrictedPoliciesInstalled() {
+        return UNRESTRICTED_POLICIES_INSTALLED;
+    }
+    
+    public static void enableStreaming(DoubleItPortType port) {
+        ((BindingProvider)port).getRequestContext().put(
+            SecurityConstants.ENABLE_STREAMING_SECURITY, "true"
+        );
+        ((BindingProvider)port).getResponseContext().put(
+            SecurityConstants.ENABLE_STREAMING_SECURITY, "true"
+        );
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/KerberosTokenTest.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/KerberosTokenTest.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/KerberosTokenTest.java
new file mode 100644
index 0000000..f7069d7
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/KerberosTokenTest.java
@@ -0,0 +1,419 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.kerberos.wssec.kerberos;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.kerberos.common.SecurityTestUtil;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.testutil.common.TestUtil;
+import org.apache.directory.server.annotations.CreateKdcServer;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifFiles;
+import org.apache.directory.server.core.annotations.CreateDS;
+import org.apache.directory.server.core.annotations.CreateIndex;
+import org.apache.directory.server.core.annotations.CreatePartition;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.server.core.kerberos.KeyDerivationInterceptor;
+import org.apache.wss4j.dom.WSSConfig;
+import org.example.contract.doubleit.DoubleItPortType;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+
+/**
+ * A set of tests for Kerberos Tokens that use an Apache DS instance as the KDC.
+ */
+
+@RunWith(FrameworkRunner.class)
+
+//Define the DirectoryService
+@CreateDS(name = "AbstractKerberosTest-class",
+    enableAccessControl = false,
+    allowAnonAccess = false,
+    enableChangeLog = true,
+    partitions = {
+        @CreatePartition(
+            name = "example",
+            suffix = "dc=example,dc=com",
+            indexes = {
+                @CreateIndex(attribute = "objectClass"),
+                @CreateIndex(attribute = "dc"),
+                @CreateIndex(attribute = "ou")
+            }
+        ) },
+    additionalInterceptors = {
+        KeyDerivationInterceptor.class
+        }
+)
+
+@CreateLdapServer(
+    transports = {
+        @CreateTransport(protocol = "LDAP")
+        }
+)
+
+@CreateKdcServer(
+    transports = {
+        // @CreateTransport(protocol = "TCP", address = "127.0.0.1", port=1024)
+        @CreateTransport(protocol = "UDP", address = "127.0.0.1")
+        },
+    primaryRealm = "service.ws.apache.org",
+    kdcPrincipal = "krbtgt/service.ws.apache.org@service.ws.apache.org"
+)
+
+//Inject an file containing entries
+@ApplyLdifFiles("kerberos.ldif")
+
+public class KerberosTokenTest extends AbstractLdapTestUnit {
+    static final String PORT = TestUtil.getPortNumber(Server.class);
+    static final String STAX_PORT = TestUtil.getPortNumber(StaxServer.class);
+    static final String PORT2 = TestUtil.getPortNumber(Server.class, 2);
+    static final String STAX_PORT2 = TestUtil.getPortNumber(StaxServer.class, 2);
+    
+    private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
+    private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
+
+    private static boolean unrestrictedPoliciesInstalled = 
+        SecurityTestUtil.checkUnrestrictedPoliciesInstalled();
+    
+    private static boolean runTests;
+    
+    public KerberosTokenTest() throws Exception {
+        String basedir = System.getProperty("basedir");
+        if (basedir == null) {
+            basedir = new File(".").getCanonicalPath();
+        }
+        
+        // Read in krb5.conf and substitute in the correct port
+        File f = new File(basedir + "/src/test/resources/krb5.conf");
+        
+        FileInputStream inputStream = new FileInputStream(f);
+        String content = IOUtils.toString(inputStream, "UTF-8");
+        inputStream.close();
+        content = content.replaceAll("port", "" + super.getKdcServer().getTransports()[0].getPort());
+        
+        File f2 = new File(basedir + "/target/test-classes/krb5.conf");
+        FileOutputStream outputStream = new FileOutputStream(f2);
+        IOUtils.write(content, outputStream, "UTF-8");
+        outputStream.close();
+        
+        System.setProperty("java.security.krb5.conf", f2.getPath());
+        System.setProperty("sun.security.krb5.debug", "false");
+    }
+    
+    @BeforeClass
+    public static void startServers() throws Exception {
+
+        WSSConfig.init();
+        
+        //
+        // This test fails with the IBM JDK
+        //
+        if (!"IBM Corporation".equals(System.getProperty("java.vendor"))) {
+            runTests = true;
+            String basedir = System.getProperty("basedir");
+            if (basedir == null) {
+                basedir = new File(".").getCanonicalPath();
+            } else {
+                basedir += "/..";
+            }
+
+            System.setProperty("sun.security.krb5.debug", "true");
+            System.setProperty("java.security.auth.login.config", 
+                               basedir + "/kerberos/src/test/resources/kerberos.jaas");
+            
+        }
+        
+        // Launch servers
+        org.junit.Assert.assertTrue(
+            "Server failed to launch",
+            // run the server in the same process
+            // set this to false to fork
+            AbstractBusClientServerTestBase.launchServer(Server.class, true)
+        );
+        
+        org.junit.Assert.assertTrue(
+            "Server failed to launch",
+            // run the server in the same process
+            // set this to false to fork
+            AbstractBusClientServerTestBase.launchServer(StaxServer.class, true)
+        );
+    }
+    
+    @org.junit.AfterClass
+    public static void cleanup() throws Exception {
+        SecurityTestUtil.cleanup();
+        AbstractBusClientServerTestBase.stopAllServers();
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverTransport() throws Exception {
+        if (!runTests) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosTransportPort";
+        runKerberosTest(portName, false, PORT2);
+        runKerberosTest(portName, false, STAX_PORT2);
+        runKerberosTest(portName, true, PORT2);
+        runKerberosTest(portName, true, STAX_PORT2);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverTransportDifferentConfiguration() throws Exception {
+        if (!runTests) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosTransportPort2";
+        runKerberosTest(portName, false, PORT2);
+        runKerberosTest(portName, false, STAX_PORT2);
+        runKerberosTest(portName, true, PORT2);
+        runKerberosTest(portName, true, STAX_PORT2);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverSymmetric() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosSymmetricPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        runKerberosTest(portName, true, PORT);
+        runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverSymmetricSupporting() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosSymmetricSupportingPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        runKerberosTest(portName, true, PORT);
+        runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosSupporting() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosSupportingPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        runKerberosTest(portName, true, PORT);
+        runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverAsymmetric() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosAsymmetricPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        runKerberosTest(portName, true, PORT);
+        runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverTransportEndorsing() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosTransportEndorsingPort";
+        runKerberosTest(portName, false, PORT2);
+        runKerberosTest(portName, false, STAX_PORT2);
+        runKerberosTest(portName, true, PORT2);
+        runKerberosTest(portName, true, STAX_PORT2);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverAsymmetricEndorsing() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosAsymmetricEndorsingPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        // TODO Streaming support
+        // runKerberosTest(portName, true, PORT);
+        // runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverSymmetricProtection() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosSymmetricProtectionPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        runKerberosTest(portName, true, PORT);
+        runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverSymmetricDerivedProtection() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosSymmetricDerivedProtectionPort";
+        runKerberosTest(portName, false, PORT);
+        // TODO Streaming support
+        // TODO Kerberos derived regression on streaming inbound
+        //runKerberosTest(portName, false, STAX_PORT);
+        //runKerberosTest(portName, true, PORT);
+        //runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverAsymmetricSignedEndorsing() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosAsymmetricSignedEndorsingPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        // TODO Streaming support
+        // runKerberosTest(portName, true, PORT);
+        // runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverAsymmetricSignedEncrypted() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosAsymmetricSignedEncryptedPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        runKerberosTest(portName, true, PORT);
+        runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverSymmetricEndorsingEncrypted() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosSymmetricEndorsingEncryptedPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        // TODO Streaming support
+        // runKerberosTest(portName, true, PORT);
+        // runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverSymmetricSignedEndorsingEncrypted() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosSymmetricSignedEndorsingEncryptedPort";
+        runKerberosTest(portName, false, PORT);
+        runKerberosTest(portName, false, STAX_PORT);
+        // TODO Streaming support
+        // runKerberosTest(portName, true, PORT);
+        // runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    @org.junit.Test
+    public void testKerberosOverSymmetricSecureConversation() throws Exception {
+        
+        if (!runTests || !unrestrictedPoliciesInstalled) {
+            return;
+        }
+        
+        String portName = "DoubleItKerberosSymmetricSecureConversationPort";
+        runKerberosTest(portName, false, PORT);
+        // TODO Streaming support
+        // runKerberosTest(portName, false, STAX_PORT);
+        // runKerberosTest(portName, true, PORT);
+        // runKerberosTest(portName, true, STAX_PORT);
+    }
+    
+    private void runKerberosTest(String portName, boolean streaming, String portNumber) throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = KerberosTokenTest.class.getResource("client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = KerberosTokenTest.class.getResource("DoubleItKerberos.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, portName);
+        DoubleItPortType kerberosPort = 
+                service.getPort(portQName, DoubleItPortType.class);
+        
+        TestUtil.updateAddressPort(kerberosPort, portNumber);
+        
+        if (streaming) {
+            SecurityTestUtil.enableStreaming(kerberosPort);
+        }
+        
+        kerberosPort.doubleIt(25);
+        
+        ((java.io.Closeable)kerberosPort).close();
+        bus.shutdown(true);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/Server.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/Server.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/Server.java
new file mode 100644
index 0000000..8e5c6c2
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/Server.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.kerberos.wssec.kerberos;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class Server extends AbstractBusTestServerBase {
+
+    public Server() {
+
+    }
+
+    protected void run()  {
+        URL busFile = Server.class.getResource("server.xml");
+        Bus busLocal = new SpringBusFactory().createBus(busFile);
+        BusFactory.setDefaultBus(busLocal);
+        setBus(busLocal);
+
+        try {
+            new Server();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/StaxServer.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/StaxServer.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/StaxServer.java
new file mode 100644
index 0000000..7877dc4
--- /dev/null
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/wssec/kerberos/StaxServer.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.kerberos.wssec.kerberos;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class StaxServer extends AbstractBusTestServerBase {
+
+    public StaxServer() {
+
+    }
+
+    protected void run()  {
+        URL busFile = StaxServer.class.getResource("stax-server.xml");
+        Bus busLocal = new SpringBusFactory().createBus(busFile);
+        BusFactory.setDefaultBus(busLocal);
+        setBus(busLocal);
+
+        try {
+            new StaxServer();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/Bethal.jks
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/Bethal.jks b/systests/kerberos/src/test/resources/Bethal.jks
new file mode 100644
index 0000000..2bf1a9a
Binary files /dev/null and b/systests/kerberos/src/test/resources/Bethal.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/DoubleItLogical.wsdl
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/DoubleItLogical.wsdl b/systests/kerberos/src/test/resources/DoubleItLogical.wsdl
new file mode 100644
index 0000000..768ac76
--- /dev/null
+++ b/systests/kerberos/src/test/resources/DoubleItLogical.wsdl
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:di="http://www.example.org/schema/DoubleIt" xmlns:tns="http://www.example.org/contract/DoubleIt" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsaw="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" name="DoubleIt" targetNamespace="http://www.example.org/contract/DoubleIt">
+    <!-- Replaced for wsp: http://schemas.xmlsoap.org/ws/2004/09/policy -->
+    <wsdl:types>
+        <xsd:schema targetNamespace="http://www.example.org/schema/DoubleIt">
+            <xsd:element name="DoubleIt">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="numberToDouble" type="xsd:int"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="DoubleIt2">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="numberToDouble" type="xsd:int"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="DoubleIt3">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="numberToDouble" type="xsd:int"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="DoubleIt4">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="numberToDouble" type="xsd:int"/>
+                        <xsd:element name="ImageData" type="xsd:base64Binary"
+                            xmime:expectedContentTypes="application/octet-stream"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="DoubleItResponse">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="doubledNumber" type="xsd:int"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="DoubleItHeader" type="xsd:int"/>
+            <xsd:element name="DoubleItFault">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="minor" type="xsd:short"/>
+                        <xsd:element name="major" type="xsd:short"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:schema>
+    </wsdl:types>
+    <wsdl:message name="DoubleItRequest">
+        <wsdl:part element="di:DoubleIt" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleIt2Request">
+        <wsdl:part element="di:DoubleIt2" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleIt3Request">
+        <wsdl:part element="di:DoubleIt3" name="parameters"/>
+        <wsdl:part name="attachment" type="xsd:base64Binary"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleIt4Request">
+        <wsdl:part element="di:DoubleIt4" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleItRequestHeader">
+        <wsdl:part element="di:DoubleIt" name="parameters"/>
+        <wsdl:part element="di:DoubleItHeader" name="header"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleItResponse">
+        <wsdl:part element="di:DoubleItResponse" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleIt2Response">
+        <wsdl:part element="di:DoubleItResponse" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleIt3Response">
+        <wsdl:part element="di:DoubleItResponse" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleIt4Response">
+        <wsdl:part element="di:DoubleItResponse" name="parameters"/>
+    </wsdl:message>
+    <wsdl:message name="DoubleItFault">
+        <wsdl:part element="di:DoubleItFault" name="DoubleItFault"/>
+    </wsdl:message>
+    <wsdl:portType name="DoubleItPortType">
+        <wsdl:operation name="DoubleIt">
+            <wsdl:input message="tns:DoubleItRequest"/>
+            <wsdl:output message="tns:DoubleItResponse"/>
+            <wsdl:fault message="tns:DoubleItFault" name="DoubleItFault"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:portType name="DoubleItPortTypeHeader">
+        <wsdl:operation name="DoubleIt">
+            <wsdl:input message="tns:DoubleItRequestHeader"/>
+            <wsdl:output message="tns:DoubleItResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:portType name="DoubleItPortType2">
+        <wsdl:operation name="DoubleIt">
+            <wsdl:input message="tns:DoubleItRequest"/>
+            <wsdl:output message="tns:DoubleItResponse"/>
+            <wsdl:fault message="tns:DoubleItFault" name="DoubleItFault"/>
+        </wsdl:operation>
+        <wsdl:operation name="DoubleIt2">
+            <wsdl:input message="tns:DoubleIt2Request"/>
+            <wsdl:output message="tns:DoubleIt2Response"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:portType name="DoubleItSwaPortType">
+        <wsdl:operation name="DoubleIt3">
+            <wsdl:input message="tns:DoubleIt3Request"/>
+            <wsdl:output message="tns:DoubleIt3Response"/>
+            <wsdl:fault message="tns:DoubleItFault" name="DoubleItFault"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:portType name="DoubleItMtomPortType">
+        <wsdl:operation name="DoubleIt4">
+            <wsdl:input message="tns:DoubleIt4Request"/>
+            <wsdl:output message="tns:DoubleIt4Response"/>
+            <wsdl:fault message="tns:DoubleItFault" name="DoubleItFault"/>
+        </wsdl:operation>
+    </wsdl:portType>
+</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/Morpit.jks
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/Morpit.jks b/systests/kerberos/src/test/resources/Morpit.jks
new file mode 100644
index 0000000..95626a7
Binary files /dev/null and b/systests/kerberos/src/test/resources/Morpit.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/Truststore.jks
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/Truststore.jks b/systests/kerberos/src/test/resources/Truststore.jks
new file mode 100644
index 0000000..e76a076
Binary files /dev/null and b/systests/kerberos/src/test/resources/Truststore.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/alice.jks
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/alice.jks b/systests/kerberos/src/test/resources/alice.jks
new file mode 100644
index 0000000..9f47a5c
Binary files /dev/null and b/systests/kerberos/src/test/resources/alice.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/alice.properties
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/alice.properties b/systests/kerberos/src/test/resources/alice.properties
new file mode 100644
index 0000000..887d848
--- /dev/null
+++ b/systests/kerberos/src/test/resources/alice.properties
@@ -0,0 +1,21 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=password
+org.apache.ws.security.crypto.merlin.keystore.alias=alice
+org.apache.ws.security.crypto.merlin.keystore.file=alice.jks

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/bob.jks
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/bob.jks b/systests/kerberos/src/test/resources/bob.jks
new file mode 100644
index 0000000..26df583
Binary files /dev/null and b/systests/kerberos/src/test/resources/bob.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/bob.properties
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/bob.properties b/systests/kerberos/src/test/resources/bob.properties
new file mode 100644
index 0000000..50a99ab
--- /dev/null
+++ b/systests/kerberos/src/test/resources/bob.properties
@@ -0,0 +1,21 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=password
+org.apache.ws.security.crypto.merlin.keystore.alias=bob
+org.apache.ws.security.crypto.merlin.keystore.file=bob.jks

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/kerberos.jaas
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/kerberos.jaas b/systests/kerberos/src/test/resources/kerberos.jaas
new file mode 100644
index 0000000..cd5b316
--- /dev/null
+++ b/systests/kerberos/src/test/resources/kerberos.jaas
@@ -0,0 +1,8 @@
+
+alice {
+    com.sun.security.auth.module.Krb5LoginModule required refreshKrb5Config=true useKeyTab=false principal="alice";
+};
+
+bob {
+    com.sun.security.auth.module.Krb5LoginModule required refreshKrb5Config=true useKeyTab=false storeKey=true principal="bob/service.ws.apache.org";
+};

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/kerberos.ldif
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/kerberos.ldif b/systests/kerberos/src/test/resources/kerberos.ldif
new file mode 100644
index 0000000..40f07fd
--- /dev/null
+++ b/systests/kerberos/src/test/resources/kerberos.ldif
@@ -0,0 +1,51 @@
+dn: dc=example,dc=com
+dc: example
+objectClass: top
+objectClass: domain
+
+dn: ou=users,dc=example,dc=com
+objectClass: organizationalUnit
+objectClass: top
+ou: users
+
+# Web server identity/service principal.
+dn: uid=bob,ou=users,dc=example,dc=com
+objectclass: top
+objectclass: person
+objectclass: inetOrgPerson
+objectclass: krb5Principal
+objectclass: krb5KDCEntry
+cn: bob
+sn: bob
+uid: bob
+userpassword: bob
+krb5PrincipalName: bob/service.ws.apache.org@service.ws.apache.org
+krb5KeyVersionNumber: 0
+
+# User / client principal.
+dn: uid=alice,ou=users,dc=example,dc=com
+objectclass: top
+objectclass: person
+objectclass: inetOrgPerson
+objectclass: krb5Principal
+objectclass: krb5KDCEntry
+cn: alice
+sn: alice
+uid: alice
+userpassword: alice
+krb5PrincipalName: alice@service.ws.apache.org
+krb5KeyVersionNumber: 0
+
+# Ticket Granting Service.
+dn: uid=krbtgt,ou=users,dc=example,dc=com
+objectclass: top
+objectclass: person
+objectclass: inetOrgPerson
+objectclass: krb5Principal
+objectclass: krb5KDCEntry
+cn: KDC Service
+sn: KDC Service
+uid: krbtgt
+userpassword: randomKey
+krb5PrincipalName: krbtgt/service.ws.apache.org@service.ws.apache.org
+krb5KeyVersionNumber: 0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/krb5.conf
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/krb5.conf b/systests/kerberos/src/test/resources/krb5.conf
new file mode 100644
index 0000000..a1a6dc9
--- /dev/null
+++ b/systests/kerberos/src/test/resources/krb5.conf
@@ -0,0 +1,7 @@
+[libdefaults]
+	default_realm = service.ws.apache.org
+
+[realms]
+	service.ws.apache.org = {
+		kdc = localhost:port
+	}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf/blob/0d19ce6a/systests/kerberos/src/test/resources/logging.properties
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/resources/logging.properties b/systests/kerberos/src/test/resources/logging.properties
new file mode 100644
index 0000000..0cf4a85
--- /dev/null
+++ b/systests/kerberos/src/test/resources/logging.properties
@@ -0,0 +1,74 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+############################################################
+#  	Default Logging Configuration File
+#
+# You can use a different file by specifying a filename
+# with the java.util.logging.config.file system property.  
+# For example java -Djava.util.logging.config.file=myfile
+############################################################
+
+############################################################
+#  	Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler 
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the INFO and above levels.
+# handlers= java.util.logging.ConsoleHandler
+
+# To also add the FileHandler, use the following line instead.
+#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overriden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+.level= INFO
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = %h/java%u.log
+java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 1
+java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
+
+# Limit the message that are printed on the console to INFO and above.
+java.util.logging.ConsoleHandler.level = INFO
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages:
+#com.xyz.foo.level = SEVERE