Package org.xulfactory.gliese.message

Examples of org.xulfactory.gliese.message.UserAuthSuccessMessage


 
  @Test
  public void shouldAuthenticateWithPassword() throws Exception
  {
    // Given
    UserAuthSuccessMessage uasm = new UserAuthSuccessMessage();
    when(transport.readMessage("password")).thenReturn(uasm);
    // When
    AuthenticationResult res = authMgr.authenticate("user", "password".toCharArray());
    // Then
    assertTrue("Authentication should succeeds", res.isSuccess());
View Full Code Here


  public void shouldAuthenticateWithKeyboardInteractive() throws Exception
  {
    // Given
    UserAuthInfoRequest uair = new UserAuthInfoRequest();
    uair.addPrompt(new UserAuthInfoRequest.Prompt("Enter password:", false));
    UserAuthSuccessMessage uasm = new UserAuthSuccessMessage();
    when(transport.readMessage("keyboard-interactive")).thenReturn(uair).thenReturn(uasm);
    KeyboardInteraction kbi = mock(KeyboardInteraction.class);
    // When
    AuthenticationResult res = authMgr.authenticate("user", kbi);
    // Then
View Full Code Here

        ((RSAPublicKey)kp.getPublic()).getModulus(),
        ((RSAPublicKey)kp.getPublic()).getPublicExponent());
    UserAuthPublicKeyOk uapkok = new UserAuthPublicKeyOk();
    uapkok.setAlgorithm("ssh-rsa");
    uapkok.setPubkey(pkey.encode());
    UserAuthSuccessMessage uasm = new UserAuthSuccessMessage();
    when(transport.readMessage("publickey")).thenReturn(uapkok).thenReturn(uasm);
    when(transport.getSessionId()).thenReturn(new byte[20]);
    // When
    AuthenticationResult res = authMgr.authenticate("user", pkey, signature);
    // Then
View Full Code Here

TOP

Related Classes of org.xulfactory.gliese.message.UserAuthSuccessMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.