[jboss-user] [Security & JAAS/JBoss] - nt login authentication

cro110011 do-not-reply at jboss.com
Tue Dec 16 09:53:11 EST 2008

hi all
I try to setup a kerberos security configuration with a standalone java client on windows xp; the client correctly gets the nt login from windows os using a configuration that looks like this:

ntlogincontextname {
  com.sun.security.auth.module.NTLoginModule required;

the client java code is as follows:

Properties props = new Properties();
props.setProperty( Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory" );
props.setProperty( Context.URL_PKG_PREFIXES, "org.jboss.naming.client" );
props.setProperty( Context.PROVIDER_URL, "jnp://localhost:1099" );
InitialContext ctx = new InitialContext( props );

TextCallbackHandler callbackHandler = new TextCallbackHandler();

LoginContext loginContext = new LoginContext( "ntlogincontextname", callbackHandler );
Subject subject = loginContext.getSubject();
log.debug( "__subject=" + subject.toString() );

// here I call the remote bean ..

When I try to extract the principal on the server side, I always get null for this principal; I don't use any nt config on the server side but a simple UsersRolesLoginModule application policy - but this should also be working, right?

I appreciate any comments :-)
regards, christian

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

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

More information about the jboss-user mailing list