Examples of SecurityAssociationCallback


Examples of org.jboss.security.auth.callback.SecurityAssociationCallback

   {
      // Get the security association info
      if( handler == null )
         throw new LoginException("No CallbackHandler provied");

      SecurityAssociationCallback sac = new SecurityAssociationCallback();
      Callback[] callbacks = { sac };
      try
      {
         handler.handle(callbacks);
         userPrincipal = sac.getPrincipal();
         clientChallenge = (byte[]) sac.getCredential();
         sac.clearCredential();
      }
      catch(java.io.IOException e)
      {
         throw new LoginException(e.toString());
      }
View Full Code Here

Examples of org.jboss.security.auth.callback.SecurityAssociationCallback

        if (callbackHandler == null) {
            throw new LoginException();
        }

        SecurityAssociationCallback callback = new SecurityAssociationCallback();
        Callback[] callbacks = {callback};
        final String username;
        try {
            callbackHandler.handle(callbacks);
            username = callback.getPrincipal().getName();
            final Object c = callback.getCredential();
            if (c instanceof SASCurrent) {
                credential = (SASCurrent) c;
            } else {
                return false;
            }
View Full Code Here

Examples of org.jboss.security.auth.callback.SecurityAssociationCallback

      validate(otherCBH);
   }
  
   private void validate(JBossCallbackHandler cbh) throws Exception
   {
      SecurityAssociationCallback sacb = new SecurityAssociationCallback();
      NameCallback ncb = new NameCallback("Enter Name");
      ObjectCallback ocb =  new ObjectCallback("Enter pass");
      PasswordCallback passcb = new PasswordCallback("Enter pass", false);
     
      Callback[] callbacks = new Callback[] {sacb, ncb, ocb, passcb};
     
      cbh.handle(callbacks);
     
      assertEquals("anil", sacb.getPrincipal().getName());
      assertEquals("testpass", sacb.getCredential());
     
      assertEquals("anil", ncb.getName());
      assertEquals("testpass", ocb.getCredential());
      assertEquals("testpass", new String(passcb.getPassword()));
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.