1. I used to authenticate the client through org.jboss.security.ClientLoginModule and the code bellow:
2. I turned this client a MBean, using the same authentication code. 3. Now I got javax.security. auth.login.FailedLoginException: Password Incorrect/Password Required when it is attemped to loginContext.login()
What needs to be changed now that my client moved to server side?
I just found out how it works: to login from a MBean (it's very weird I know), you have to use "client-login" as domain. Don't ask me why this thing only works like this, in my opinion could be a JBoss bug
// e.g. LoginContext loginContext = new LoginContext("client-login", new Subject(), new SecurityAssociationHandler()); loginContext.login();