org.apache.ws.security.saml
Class SamlReferenceTest

java.lang.Object
  extended by org.junit.Assert
      extended by org.apache.ws.security.saml.SamlReferenceTest

public class SamlReferenceTest
extends org.junit.Assert

Some tests for how SAML tokens are referenced.


Constructor Summary
SamlReferenceTest()
           
 
Method Summary
 void testAssertionBelowSTR()
          WS-Security Test Case for WSS-178 - "signature verification failure of signed saml token due to "The Reference for URI (bst-saml-uri) has no XMLSignatureInput".
 void testSAML1HOKDirectReference()
          Test that creates, sends and processes an signed SAML 1.1 holder-of-key assertion, where the SecurityTokenReference that points to the SAML Assertion uses a direct reference, and not a KeyIdentifier.
 void testSAML1HOKEKDirectReference()
          The body of the SOAP request is encrypted using a secret key, which is in turn encrypted using the certificate embedded in the SAML assertion and referenced using Direct Reference.
 void testSAML1HOKEKKeyIdentifier()
          The body of the SOAP request is encrypted using a secret key, which is in turn encrypted using the certificate embedded in the SAML assertion and referenced using a Key Identifier.
 void testSAML1HOKKeyIdentifier()
          Test that creates, sends and processes an signed SAML 1.1 holder-of-key assertion, where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier, and not a direct reference.
 void testSAML1SVDirectReference()
          Test that creates, sends and processes an signed SAML 1.1 sender-vouches assertion, where the SecurityTokenReference that points to the SAML Assertion uses a direct reference, and not a KeyIdentifier.
 void testSAML1SVKeyIdentifier()
          Test that creates, sends and processes an signed SAML 1.1 sender-vouches assertion, where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier, and not a direct reference.
 void testSAML2HOKDirectReference()
          Test that creates, sends and processes an signed SAML 2 holder-of-key assertion, where the SecurityTokenReference that points to the SAML Assertion uses a direct reference, and not a KeyIdentifier.
 void testSAML2HOKEKDirectReference()
          The body of the SOAP request is encrypted using a secret key, which is in turn encrypted using the certificate embedded in the SAML assertion and referenced using Direct Reference.
 void testSAML2HOKEKKeyIdentifier()
          The body of the SOAP request is encrypted using a secret key, which is in turn encrypted using the certificate embedded in the SAML assertion and referenced using a Key Identifier.
 void testSAML2HOKKeyIdentifier()
          Test that creates, sends and processes an signed SAML 2 holder-of-key assertion, where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier, and not a direct reference.
 void testSAML2SVDirectReference()
          Test that creates, sends and processes an signed SAML 2 sender-vouches assertion, where the SecurityTokenReference that points to the SAML Assertion uses a direct reference, and not a KeyIdentifier.
 void testSAML2SVKeyIdentifier()
          Test that creates, sends and processes an signed SAML 2 sender-vouches assertion, where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier, and not a direct reference.
 
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

SamlReferenceTest

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

testSAML1SVKeyIdentifier

public void testSAML1SVKeyIdentifier()
                              throws java.lang.Exception
Test that creates, sends and processes an signed SAML 1.1 sender-vouches assertion, where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier, and not a direct reference.

Throws:
java.lang.Exception

testSAML1SVDirectReference

public void testSAML1SVDirectReference()
                                throws java.lang.Exception
Test that creates, sends and processes an signed SAML 1.1 sender-vouches assertion, where the SecurityTokenReference that points to the SAML Assertion uses a direct reference, and not a KeyIdentifier. This method is not spec compliant and is included to make sure we can process third-party Assertions referenced in this way.

Throws:
java.lang.Exception

testSAML1HOKKeyIdentifier

public void testSAML1HOKKeyIdentifier()
                               throws java.lang.Exception
Test that creates, sends and processes an signed SAML 1.1 holder-of-key assertion, where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier, and not a direct reference. This tests that we can process a KeyIdentifier to a SAML Assertion in the KeyInfo of a Signature.

Throws:
java.lang.Exception

testSAML1HOKDirectReference

public void testSAML1HOKDirectReference()
                                 throws java.lang.Exception
Test that creates, sends and processes an signed SAML 1.1 holder-of-key assertion, where the SecurityTokenReference that points to the SAML Assertion uses a direct reference, and not a KeyIdentifier. This method is not spec compliant and is included to make sure we can process third-party Assertions referenced in this way. This tests that we can process a Direct Reference to a SAML Assertion in the KeyInfo of a Signature.

Throws:
java.lang.Exception

testAssertionBelowSTR

public void testAssertionBelowSTR()
                           throws java.lang.Exception
WS-Security Test Case for WSS-178 - "signature verification failure of signed saml token due to "The Reference for URI (bst-saml-uri) has no XMLSignatureInput". The problem is that the signature is referring to a SecurityTokenReference via the STRTransform, which in turn is referring to the SAML Assertion. The request is putting the SAML Assertion below the SecurityTokenReference, and this is causing SecurityTokenReference.getTokenElement to fail.

Throws:
java.lang.Exception

testSAML1HOKEKKeyIdentifier

public void testSAML1HOKEKKeyIdentifier()
                                 throws java.lang.Exception
The body of the SOAP request is encrypted using a secret key, which is in turn encrypted using the certificate embedded in the SAML assertion and referenced using a Key Identifier. This tests that we can process a KeyIdentifier to a SAML Assertion in the KeyInfo of an EncryptedKey.

Throws:
java.lang.Exception

testSAML1HOKEKDirectReference

public void testSAML1HOKEKDirectReference()
                                   throws java.lang.Exception
The body of the SOAP request is encrypted using a secret key, which is in turn encrypted using the certificate embedded in the SAML assertion and referenced using Direct Reference. This method is not spec compliant and is included to make sure we can process third-party Assertions referenced in this way. This tests that we can process a Direct Reference to a SAML Assertion in the KeyInfo of an EncryptedKey.

Throws:
java.lang.Exception

testSAML2SVKeyIdentifier

public void testSAML2SVKeyIdentifier()
                              throws java.lang.Exception
Test that creates, sends and processes an signed SAML 2 sender-vouches assertion, where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier, and not a direct reference.

Throws:
java.lang.Exception

testSAML2SVDirectReference

public void testSAML2SVDirectReference()
                                throws java.lang.Exception
Test that creates, sends and processes an signed SAML 2 sender-vouches assertion, where the SecurityTokenReference that points to the SAML Assertion uses a direct reference, and not a KeyIdentifier. Unlike the SAML 1.1 case, this is spec-compliant.

Throws:
java.lang.Exception

testSAML2HOKKeyIdentifier

public void testSAML2HOKKeyIdentifier()
                               throws java.lang.Exception
Test that creates, sends and processes an signed SAML 2 holder-of-key assertion, where the SecurityTokenReference that points to the SAML Assertion uses a KeyIdentifier, and not a direct reference. This tests that we can process a KeyIdentifier to a SAML Assertion in the KeyInfo of a Signature.

Throws:
java.lang.Exception

testSAML2HOKDirectReference

public void testSAML2HOKDirectReference()
                                 throws java.lang.Exception
Test that creates, sends and processes an signed SAML 2 holder-of-key assertion, where the SecurityTokenReference that points to the SAML Assertion uses a direct reference, and not a KeyIdentifier. Unlike the SAML 1.1 case, this is spec-compliant. This tests that we can process a Direct Reference to a SAML Assertion in the KeyInfo of a Signature.

Throws:
java.lang.Exception

testSAML2HOKEKKeyIdentifier

public void testSAML2HOKEKKeyIdentifier()
                                 throws java.lang.Exception
The body of the SOAP request is encrypted using a secret key, which is in turn encrypted using the certificate embedded in the SAML assertion and referenced using a Key Identifier. This tests that we can process a KeyIdentifier to a SAML Assertion in the KeyInfo of an EncryptedKey.

Throws:
java.lang.Exception

testSAML2HOKEKDirectReference

public void testSAML2HOKEKDirectReference()
                                   throws java.lang.Exception
The body of the SOAP request is encrypted using a secret key, which is in turn encrypted using the certificate embedded in the SAML assertion and referenced using Direct Reference. Unlike the SAML 1.1 case, this is spec-compliant. This tests that we can process a Direct Reference to a SAML Assertion in the KeyInfo of an EncryptedKey.

Throws:
java.lang.Exception


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