org.apache.ws.security.message.token
Class KerberosTest

java.lang.Object
  extended by org.junit.Assert
      extended by org.apache.ws.security.message.token.KerberosTest

public class KerberosTest
extends org.junit.Assert

This is a test for a WSS4J client retrieving a service ticket from a KDC, and inserting it into the security header of a request, to be processed by WSS4J. The tests are @Ignored by default, as a KDC is needed. To replicate the test scenario, set up a KDC with user principal "alice" (keytab in "/etc/alice.keytab"), and host service "bob@service.ws.apache.org" (keytab in "/etc/bob.keytab"). The test can be run with: mvn -Djava.security.auth.login.config=src/test/resources/kerberos.jaas test -Dtest=KerberosTest To see the Kerberos stuff add "-Dsun.security.krb5.debug=true".


Constructor Summary
KerberosTest()
           
 
Method Summary
 void testKerberosClient()
          Various unit tests for a kerberos client
 void testKerberosCreationAndProcessing()
          Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and process it.
 void testKerberosEncryption()
          Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to encrypt the SOAP Body.
 void testKerberosEncryptionBSTFirst()
          Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to encrypt the SOAP Body.
 void testKerberosEncryptionKI()
          Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to encrypt the SOAP Body.
 void testKerberosSignature()
          Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to sign the SOAP Body.
 void testKerberosSignatureKI()
          Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to sign the SOAP Body.
 void testSpnego()
          Get and validate a SPNEGO token.
 
Methods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KerberosTest

public KerberosTest()
             throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

testKerberosCreationAndProcessing

public void testKerberosCreationAndProcessing()
                                       throws java.lang.Exception
Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and process it.

Throws:
java.lang.Exception

testSpnego

public void testSpnego()
                throws java.lang.Exception
Get and validate a SPNEGO token.

Throws:
java.lang.Exception

testKerberosClient

public void testKerberosClient()
                        throws java.lang.Exception
Various unit tests for a kerberos client

Throws:
java.lang.Exception

testKerberosSignature

public void testKerberosSignature()
                           throws java.lang.Exception
Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to sign the SOAP Body.

Throws:
java.lang.Exception

testKerberosSignatureKI

public void testKerberosSignatureKI()
                             throws java.lang.Exception
Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to sign the SOAP Body.

Throws:
java.lang.Exception

testKerberosEncryption

public void testKerberosEncryption()
                            throws java.lang.Exception
Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to encrypt the SOAP Body.

Throws:
java.lang.Exception

testKerberosEncryptionBSTFirst

public void testKerberosEncryptionBSTFirst()
                                    throws java.lang.Exception
Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to encrypt the SOAP Body.

Throws:
java.lang.Exception

testKerberosEncryptionKI

public void testKerberosEncryptionKI()
                              throws java.lang.Exception
Test using the KerberosSecurity class to retrieve a service ticket from a KDC, wrap it in a BinarySecurityToken, and use the session key to encrypt the SOAP Body.

Throws:
java.lang.Exception


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.