[jboss-user] [Security & JAAS/JBoss] - Have problem about "org.jboss.security.ClientLoginModule "

changemylife do-not-reply at jboss.com
Wed Jan 31 08:21:36 EST 2007


Hi all !
   On the client, I write:
     String path = Test.class.getProtectionDomain().getCodeSource().getLocation().getPath();
		if (path.endsWith(".jar")) 
			path = path.substring(0, path.lastIndexOf("\\"));
          System.getProperties().setProperty("java.security.auth.login.config", path + "user.conf");		 
          System.getProperties().setProperty("java.security.policy", path + "user.policy");
	   System.setSecurityManager(new SecurityManager());

           LoginContext lc = new LoginContext("clientTest", new MyCallbackHandler());
		lc.login();
   And my user.config:
       userTest {
		org.jboss.security.ClientLoginModule required;
       };
   And my user.policy:
       grant codebase "file:/-" {
             permission javax.security.auth.AuthPermission "createLoginContext.clientTest";
             permission java.util.PropertyPermission "*", "read";
             permission java.security.AllPermission;
};
   After I enter username and password. I receive some messages:
--------
   Exception in thread "main" javax.security.auth.login.LoginException: Security Exception
	at javax.security.auth.login.LoginContext.invoke(Unknown Source)
	at javax.security.auth.login.LoginContext.access$000(Unknown Source)
	at javax.security.auth.login.LoginContext$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
	at javax.security.auth.login.LoginContext.login(Unknown Source)
	at client.test.Test.main(Test.java:34)
Caused by: java.lang.SecurityException
	... 7 more
  Have any idea ? Thanks.

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

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



More information about the jboss-user mailing list