In that case, you can use the PropertiesBackendEngine.

As all backend engines (you have one backend engine per login module), you have methods like:
listUsers()
listRoles()
etc

They are exposed as OSGi services, so you can use it programmatically.

The UserPrincipal gives you the username.

For the password, for security reason, you can't retrieve the password, but you can validate a given password (as you should do with JAAS).

The big advantage of using backend engine is that you don't care of the actual login module. An alternative in your case would be to parse the etc/users.properties yourself (Properties properties = Properties.load(System.getProperty("karaf.etc)" + "users.properties"), but it works only when you use the PropertiesLoginModule.

Regards
JB

On 04/03/2015 09:07 AM, xav wrote:
Hi JB,

I don't want to add realm, but reusing, getting  properties inside this
class:
org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.java

I just want to access at the login + password inside the users.properties,
without parsing myself this file (if it's possible)?

Thank you

Regards




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Jaas-and-users-properties-tp4039414p4039438.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to