Hi all,
When I try to use ClientLoginModule (new LoginContext("client-login", handler);
):
public static void main(String[] args) {
| AppCallbackHandler handler = new
AppCallbackHandler("username","password".toCharArray());
| System.setProperty("java.security.auth.login.config",
PATH+"/auth.conf");
| LoginContext lc;
|
| try {
|
| lc = new LoginContext("client-login", handler);
|
| lc.login();
| Properties jndiProperties = new Properties();
| jndiProperties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
| jndiProperties.setProperty(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interface");
| jndiProperties.setProperty(Context.PROVIDER_URL,
"jnp://localhost:1099");
|
| Context context = new InitialContext(jndiProperties);
| MyEJBHome home = (MyEJBHome)context.lookup(MyEJBHome.JNDI_NAME);
| home.create();
| ...
I recive exception:
java.rmi.AccessException: SecurityException; nested exception is:
| java.lang.SecurityException: Insufficient method permissions, principal=username,
ejbName=MyEJB, method=create, interface=HOME, requiredRoles=[], principalRoles=null
| at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:370)
| at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:125)
| at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
| at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
| at org.jboss.ejb.Container.invoke(Container.java:894)
|
DatabaseServerLoginModule don't assign principalRoles to principal=username. The user
has principalRoles=null.
Can anybody help me pls.
Thanks.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963979#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...