Java Code Examples for org.apache.ws.security.handler.WSHandlerConstants#TIMESTAMP

The following examples show how to use org.apache.ws.security.handler.WSHandlerConstants#TIMESTAMP . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserNameTokenAuthorizationTest.java    From steady with Apache License 2.0 6 votes vote down vote up
@Test
public void testDigestPasswordUnauthorized() throws Exception {
    setUpService("managers", true, false);
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    try {
        echo.echo("test");
        fail("Exception expected");
    } catch (Exception ex) {
        assertEquals("Unauthorized", ex.getMessage());
    }
}
 
Example 2
Source File: UserNameTokenAuthorizationTest.java    From steady with Apache License 2.0 6 votes vote down vote up
@Test
public void testDigestPasswordUnauthorized() throws Exception {
    setUpService("managers", true, false);
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    try {
        echo.echo("test");
        fail("Exception expected");
    } catch (Exception ex) {
        assertEquals("Unauthorized", ex.getMessage());
    }
}
 
Example 3
Source File: UserNameTokenAuthorizationTest.java    From steady with Apache License 2.0 6 votes vote down vote up
@Test
public void testDigestPasswordUnauthorized() throws Exception {
    setUpService("managers", true, false);
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    try {
        echo.echo("test");
        fail("Exception expected");
    } catch (Exception ex) {
        assertEquals("Unauthorized", ex.getMessage());
    }
}
 
Example 4
Source File: UserNameTokenAuthorizationTest.java    From steady with Apache License 2.0 6 votes vote down vote up
@Test
public void testDigestPasswordUnauthorized() throws Exception {
    setUpService("managers", true, false);
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    try {
        echo.echo("test");
        fail("Exception expected");
    } catch (Exception ex) {
        assertEquals("Unauthorized", ex.getMessage());
    }
}
 
Example 5
Source File: RoundTripTest.java    From steady with Apache License 2.0 5 votes vote down vote up
@Test
public void testUsernameToken() throws Exception {
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    assertEquals("test", echo.echo("test"));
}
 
Example 6
Source File: UserNameTokenAuthorizationTest.java    From steady with Apache License 2.0 5 votes vote down vote up
@Test
public void testDigestPasswordAuthorized() throws Exception {
    setUpService("developers", true, false);
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    assertEquals("test", echo.echo("test"));
}
 
Example 7
Source File: RoundTripTest.java    From steady with Apache License 2.0 5 votes vote down vote up
@Test
public void testUsernameToken() throws Exception {
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    assertEquals("test", echo.echo("test"));
}
 
Example 8
Source File: UserNameTokenAuthorizationTest.java    From steady with Apache License 2.0 5 votes vote down vote up
@Test
public void testDigestPasswordAuthorized() throws Exception {
    setUpService("developers", true, false);
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    assertEquals("test", echo.echo("test"));
}
 
Example 9
Source File: RoundTripTest.java    From steady with Apache License 2.0 5 votes vote down vote up
@Test
public void testUsernameToken() throws Exception {
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    assertEquals("test", echo.echo("test"));
}
 
Example 10
Source File: UserNameTokenAuthorizationTest.java    From steady with Apache License 2.0 5 votes vote down vote up
@Test
public void testDigestPasswordAuthorized() throws Exception {
    setUpService("developers", true, false);
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    assertEquals("test", echo.echo("test"));
}
 
Example 11
Source File: RoundTripTest.java    From steady with Apache License 2.0 5 votes vote down vote up
@Test
public void testUsernameToken() throws Exception {
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    assertEquals("test", echo.echo("test"));
}
 
Example 12
Source File: UserNameTokenAuthorizationTest.java    From steady with Apache License 2.0 5 votes vote down vote up
@Test
public void testDigestPasswordAuthorized() throws Exception {
    setUpService("developers", true, false);
    String actions = WSHandlerConstants.ENCRYPT + " " + WSHandlerConstants.SIGNATURE + " "
                     + WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.USERNAME_TOKEN;

    wsIn.setProperty(WSHandlerConstants.ACTION, actions);
    
    wsOut.setProperty(WSHandlerConstants.ACTION, actions);

    assertEquals("test", echo.echo("test"));
}