[jboss-user] [Beginners Corner] - Re: security Insufficient method permissions, principal=null

srki do-not-reply at jboss.com
Mon Oct 2 22:36:48 EDT 2006


  | 	 static class AppCallbackHandler implements CallbackHandler {
  | 		 private String username;
  | 		 private char[] password;
  | 
  | 		 public AppCallbackHandler(String username, char[] password){
  | 		 this.username = username;
  | 		 this.password = password;
  | 		 }
  | 
  | 		 public void handle(Callback[] callbacks)
  | 		 throws java.io.IOException, UnsupportedCallbackException {
  | 			 for (int i = 0; i < callbacks.length; i++) {
  | 				 if (callbacks instanceof NameCallback){
  | 					 NameCallback nc = (NameCallback)callbacks ;
  | 					 nc.setName(username);
  | 				 } else if (callbacks instanceof PasswordCallback) {
  | 					 PasswordCallback pc = (PasswordCallback)callbacks ;
  | 					 pc.setPassword(password);
  | 				 } else {
  | 					 throw new UnsupportedCallbackException(callbacks , "Unrecognized Callback");
  | 				 }
  | 			 }
  | 		 	}
  | 		 } 
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975647#3975647

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975647



More information about the jboss-user mailing list