I'm actually trying to resolve this problem.
I'm thinking if I can access the user registry (whatever java API it has) from inside my application, through JNDI.
Googling around I found the following code for WAS classic:
import com.ibm.websphere.security.UserRegistry;
{
Context ic = new InitialContext();
Object objRef = ic.lookup("UserRegistry");
UserRegistry userReg = (UserRegistry)PortableRemoteObject.narrow(objRef, UserRegistry.class);
...
}
CAUTION: I don't know if this code works. I haven't tested it.
But "UserRegistry" is not available in JNDI's root context. As of now, my server lists the following bindings: "ejb", "jdbc", "services" plus some other private bindings we have in our server.xml.
rslemos Liberty provides User Registry APIs. I'm not sure if they align with your goals, but sharing them below for your review.