In full version of Websphere you can define JAAS Authentication Entries. Those entries has unique ID, username and password. Usually those are bounded to other configuration entries in WAS, for instance DataSource configurations.
But sometimes you need to access J2C records straight from application code via API. There are couple of post here explaining how to do it in WAS. Usually what you do is:
LoginContext loginContext = new LoginContext("DefaultPrincipalMapping", callbackHandler);
loginContext.login();
It does indeed work in WAS via JCA API, but not in Websphere Liberty Profile. Is there any way to access J2C AuthData in Websphere Liberty Profile? What is minimum configuration required to setup J2C in server.xml for the purpose?
We have something like:
<featureManager>
<feature>appSecurity-2.0</feature>
</featureManager>
<authData id="someAppCredentials" user="someUser" password="some Password"/>
<jaasLoginContextEntry id="DefaultPrincipalMapping" name="DefaultPrincipalMapping" loginModuleRef="userNameAndPassword"/>
but it is clearly not enough since WLP throws: javax.security.auth.login.LoginException: No LoginModules configured for DefaultPrincipalMapping if you try to do loginContext.login().