posted 19 years ago
Hello,
excuse me I know this problem is recurrent but I have a problem with authentication process.
I have a problem when I create loginContext in my application.
Maybe you can help me :
I create auth.conf
MyLogin
{
//Login Module Needed - I use Database (Note it correlates to what I had in login-config.xml
org.jboss.security.auth.spi.DatabaseServerLoginModule required;
};
//NOT 100% SURE IF THIS IS NEEDED, SINCE I HAVEN'T DONE THIS IN A WHILE AND I FORGET,
//BUT IT'S IN MY FILE (Although I think it's not needed)
other
{
//DEFAULT CLIENT-LOGIN MODULE
org.jboss.security.ClientLoginModule required;
};
i create a policy :grant codebase "file:./*" { permission javax.security.auth.AuthPermission "createLoginContext.MyLogin";
When i did in my code this method :
loginContext = new LoginContext( "MyLogin", ( CallbackHandler ) handler );
I receive a message : access denied (javax.security.auth.AuthPermission createLoginContext.MyLogin)
I don't understand because i have a policy text with allpermission.
arguments when i compile are : -Djava.security.policy=ourtest.policy.txt -Djava.security.manager -Djava.security.auth.login.config=auth.conf.txt
thanks for your help