0 Replies Latest reply: Mar 14, 2014 5:02 AM by Moh RSS

    JAAS: access denied (javax.security.auth.AuthPermission createLoginContext.Sample)

    Moh

      Hi all,

      I realize a sample for JAAS Authentication Tutorial from http://download.java.net/jdk8/docs/technotes/guides/security/jaas/tutorials/GeneralAcnOnly.html

      and get the following error:

      Cannot create LoginContext. properies!access denied (javax.security.auth.AuthPermission createLoginContext.Sample) java.security.AccessControlException: access denied (javax.security.auth.AuthPermission createLoginContext.Sample) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at javax.security.auth.login.LoginContext.init(LoginContext.java:224) at javax.security.auth.login.LoginContext.(LoginContext.java:403) at sample.SampleAcn.main(SampleAcn.java:92)

       

      It is clear to me, that sampleacn.policy have to grant permission to files, but it is not work correct.

      grant codebase "file:./SampleLM.jar" {    permission javax.security.auth.AuthPermission "modifyPrincipals"; };

       

      grant codebase "file:./SampleAcn.jar" {    permission javax.security.auth.AuthPermission "createLoginContext.Sample"; };

       

      What is wrong? How can I solve the issue?

      Regards,

      Moh