Class UsernameTokenTest

    • Constructor Detail

      • UsernameTokenTest

        public UsernameTokenTest()
    • Method Detail

      • testUsernameTokenDigest

        @Test
        public void testUsernameTokenDigest()
                                     throws Exception
        Test that adds a UserNameToken with password Digest to a WS-Security envelope
        Throws:
        Exception
      • testUsernameTokenWithEncodedPasswordBaseline

        @Test
        public void testUsernameTokenWithEncodedPasswordBaseline()
                                                          throws Exception
        Test for encoded passwords.
        Throws:
        Exception
      • testUsernameTokenWithEncodedPassword

        @Test
        public void testUsernameTokenWithEncodedPassword()
                                                  throws Exception
        Test that adds a UserNameToken with password Digest to a WS-Security envelope
        Throws:
        Exception
      • testUsernameTokenBadUsername

        @Test
        public void testUsernameTokenBadUsername()
                                          throws Exception
        Test that a bad username with password digest does not leak whether the username is valid or not - see WSS-141.
        Throws:
        Exception
      • testUsernameTokenBadDigest

        @Test
        public void testUsernameTokenBadDigest()
                                        throws Exception
        Test that adds a UserNameToken with a bad password Digest to a WS-Security envelope
        Throws:
        Exception
      • testOldUsernameToken

        @Test
        public void testOldUsernameToken()
                                  throws Exception
        This is a test for processing an "old" UsernameToken, i.e. one with a "Created" element that is out of date
        Throws:
        Exception
      • testNearFutureCreated

        @Test
        public void testNearFutureCreated()
                                   throws Exception
        This is a test for processing a UsernameToken where the "Created" element is in the (near) future. It should be accepted by default when it is created 30 seconds in the future, and then rejected once we configure "0 seconds" for future-time-to-live.
        Throws:
        Exception
      • testFutureCreated

        @Test
        public void testFutureCreated()
                               throws Exception
        This is a test for processing a UsernameToken where the "Created" element is in the future. A UsernameToken that is 120 seconds in the future should be rejected by default.
        Throws:
        Exception
      • testUsernameTokenText

        @Test
        public void testUsernameTokenText()
                                   throws Exception
        Test that adds a UserNameToken with password text to a WS-Security envelope
        Throws:
        Exception
      • testUsernameTokenDigestText

        @Test
        public void testUsernameTokenDigestText()
                                         throws Exception
        Test that adds a UserNameToken with a digested password but with type of password test.
        Throws:
        Exception
      • testUsernameTokenBadText

        @Test
        public void testUsernameTokenBadText()
                                      throws Exception
        Test that adds a UserNameToken with (bad) password text to a WS-Security envelope
        Throws:
        Exception
      • testUsernameTokenNoPasswordType

        @Test
        public void testUsernameTokenNoPasswordType()
                                             throws Exception
        Test that adds a UserNameToken with no password type to a WS-Security envelope See WSS-152 - https://issues.apache.org/jira/browse/WSS-152 "Problem with processing Username Tokens with no password type" The 1.1 spec states that the password type is optional and defaults to password text, and so we should handle an incoming Username Token accordingly.
        Throws:
        Exception
      • testUsernameTokenNoUser

        @Test
        public void testUsernameTokenNoUser()
                                     throws Exception
        Test that adds a UserNameToken with no user (or password) to a WS-Security envelope See WSS-185 - https://issues.apache.org/jira/browse/WSS-185 "NullPointerException on empty UsernameToken"
        Throws:
        Exception
      • testUsernameTokenNoPassword

        @Test
        public void testUsernameTokenNoPassword()
                                         throws Exception
        Test that adds a UserNameToken with no password
        Throws:
        Exception
      • testUsernameTokenEmptyPassword

        @Test
        public void testUsernameTokenEmptyPassword()
                                            throws Exception
        Test that adds a UserNameToken with an empty password
        Throws:
        Exception
      • testEmptyPasswordProcessing

        @Test
        public void testEmptyPasswordProcessing()
                                         throws Exception
        Test that processes a UserNameToken with an empty password
        Throws:
        Exception
      • testUsernameTokenCustomFail

        @Test
        public void testUsernameTokenCustomFail()
                                         throws Exception
        Test with a non-standard token type. This will fail as the default is to reject custom token types.
        Throws:
        Exception
      • testUsernameTokenCustomPass

        @Test
        public void testUsernameTokenCustomPass()
                                         throws Exception
        Test with a non-standard password type. This will pass as the WSSConfig is configured to handle custom token types.
        Throws:
        Exception
      • testNullNonce

        @Test
        public void testNullNonce()
                           throws Exception
        A test for WSS-66 - the nonce string is null http://issues.apache.org/jira/browse/WSS-66 "Possible security hole when PasswordDigest is used by client."
        Throws:
        Exception
      • testNullCreated

        @Test
        public void testNullCreated()
                             throws Exception
        A test for WSS-66 - the created string is null http://issues.apache.org/jira/browse/WSS-66 "Possible security hole when PasswordDigest is used by client."
        Throws:
        Exception
      • testUsernameTokenNonceEncodingType

        @Test
        public void testUsernameTokenNonceEncodingType()
                                                throws Exception
        Test that verifies an EncodingType is set for the nonce. See WSS-169.
        Throws:
        Exception
      • testUsernameTokenWSHandler

        @Test
        public void testUsernameTokenWSHandler()
                                        throws Exception
        Test that adds a UserNameToken via WSHandler
        Throws:
        Exception
      • testUsernameTokenWSHandlerNoPassword

        @Test
        public void testUsernameTokenWSHandlerNoPassword()
                                                  throws Exception
        Test that adds a UserNameToken with no password via WSHandler
        Throws:
        Exception
      • testUsernameTokenWSHandlerNoPassword2

        @Test
        public void testUsernameTokenWSHandlerNoPassword2()
                                                   throws Exception
        Test that adds a UserNameToken with no password via WSHandler
        Throws:
        Exception
      • testUsernameTokenWSHandlerEmptyPassword

        @Test
        public void testUsernameTokenWSHandlerEmptyPassword()
                                                     throws Exception
        Test that adds a UserNameToken with an empty password via WSHandler
        Throws:
        Exception
      • testMultipleNonce

        @Test
        public void testMultipleNonce()
                               throws Exception
        A test for sending multiple nonces in the UsernameToken
        Throws:
        Exception
      • testMultipleCreated

        @Test
        public void testMultipleCreated()
                                 throws Exception
        A test for sending multiple Created elements in the UsernameToken
        Throws:
        Exception
      • testMultiplePassword

        @Test
        public void testMultiplePassword()
                                  throws Exception
        A test for sending multiple passwords in the UsernameToken
        Throws:
        Exception
      • testNonceBadEncodingType

        @Test
        public void testNonceBadEncodingType()
                                      throws Exception
        A test for sending a nonce with a bad encoding type in the UsernameToken
        Throws:
        Exception
      • testUsernameTokenWSHandlerNonceCreated

        @Test
        public void testUsernameTokenWSHandlerNonceCreated()
                                                    throws Exception
        Throws:
        Exception
      • testSpoofedUsernameToken

        @Test
        public void testSpoofedUsernameToken()
                                      throws Exception
        This is a test to create a "Spoofed" UsernameToken (see WSS-441)
        Throws:
        Exception