Package org.xulfactory.gliese.message

Examples of org.xulfactory.gliese.message.UserAuthInfoRequest


      if (lastMessage == null) {
        UserAuthRequestMessage msg = initUserAuthRequestMessage();
        msg.setAuthenticationData(new KeyboardInteractiveMethodData(""));
        return msg;
      }
      UserAuthInfoRequest req = (UserAuthInfoRequest)lastMessage;
      if (req.getInstruction() != null) {
        kbi.prompt(req.getInstruction());
      }
      Iterator<UserAuthInfoRequest.Prompt> it = req.promptIterator();
      UserAuthInfoResponse rsp = new UserAuthInfoResponse();
      while (it.hasNext()) {
        UserAuthInfoRequest.Prompt prompt = it.next();
        String reply = kbi.reply(prompt.getPrompt(), prompt.isEcho());
        rsp.addResponse(reply);
View Full Code Here


 
  @Test
  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);
View Full Code Here

TOP

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

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.