I'm using Liberty JAAS CustomLoginModule to customize my login module for authentication. I already pass the authentication but failed in authorization because I cannot get user registry. From the trace I can see when I use
this.userRegistry = this.getUserRegistry();
it will issue:
java.lang.NullPointerException
at com.ibm.ws.security.authentication.internal.jaas.JAASServiceImpl.getUserRegistry(JAASServiceImpl.java:122)
However, from the trace, I can see my info configured in server.xml has been put into Liberty.
*{com.ibm.ws.security.registry.UserRegistry}={user.0.password=*****, user.0.config.referenceType=com.ibm.ws.security.registry.basic.config.user, realm=zosConnect, service.scope=bundle, component.name=com.ibm.ws.security.registry.basic.internal.BasicRegistry, group.0.member.0.name=Fred, user.0.name=Fred, config.source=file, group.0.config.referenceType=com.ibm.ws.security.registry.basic.config.group, id=basic1, service.pid=com.ibm.ws.security.registry.basic.config_39, group.0.name=ADMIN, service.id=260, service.bundleid=31, config.overrides=true, com.ibm.ws.security.registry.type=Basic, component.id=73, config.id=com.ibm.ws.security.registry.basic.config[basic1], group.0.member.0.config.referenceType=com.ibm.ws.security.registry.basic.config.group.member, service.factoryPid=com.ibm.ws.security.registry.basic.config, ignoreCaseForAuthentication=false, service.vendor=IBM, config.displayId=basicRegistry[basic1]}
[5/20/18 15:47:01:012 GMT] 00000015 id=d64f0d3e om.ibm.ws.security.registry.internal.UserRegistryServiceImpl >*
So, is there any way to getUserRegistry? Or is there any way to make it pass authorization?
Looking forward to the answer, thanks a lot.
You should be using the RegistryHelper.getUserRegistry( ) method to get the UR - more info at https://www.ibm.com/support/knowledgecenter/SSAW57_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_sec_apis.html
Regards, Ut Le