Alexey Tomin [
https://community.jboss.org/people/alxt] commented on the document
"JBoss AS7: Security : Custom Login Modules"
To view all comments on this document, visit:
https://community.jboss.org/docs/DOC-17357#comment-10067
--------------------------------------------------
In 7.1.1 I try use custom module
1. in standalone-full.xml:
<security-domain name="RolesLoginModule">
<authentication>
<login-module
code="ru.infosfera.common.auth.server_module.RolesLoginModule"
flag="required"/>
...
2. in my EAR in JAR add class ru.infosfera.common.auth.server_module.RolesLoginModule
(implements LoginModule) and in class log all operations (initialize, login, commit,
abort, logout).
3. in JAR add META-INF/jboss.xml with
<jboss><security-domain>RolesLoginModule</security-domain></jboss>
In EAR no files for jboss.
4. In client add parameters fomr InitialContext
params.put("java.naming.security.principal", username);
params.put("java.naming.security.credentials", password);
5. After make InitialContext call LoginContext.login() with CallbackHandler, what return
username and password (overlapping of #4)
6. Try get remote interface (lookup) and failed:
2:09:04.629:Remoting "config-based-naming-client-endpoint"
read-1:ERROR:org.jboss.remoting.remote.connection::JBREM000200: Remote connection failed:
javax.security.sasl.SaslException: Authentication failed: all available authentication
mechanisms failed
12:09:04.629:main :TRACE:ru.infosfera.common.ejb.JndiHelper ::not found jndiName:
ejb:StartNg.twf-3.S3-SNAPSHOT/Common.auth.ejb-3.S3-SNAPSHOT//AdmContextBL!ru.infosfera.common.auth.bl.AdmContextRemote
javax.security.auth.login.LoginException: Failed to create remoting connection
7. In server NO LOG from my RolesLoginModule.
What am I doing wrong?
How to do the right thing?
--------------------------------------------------