How to programmatically configure / chain JAAS logins, as if they were loaded from login.conf?

I am trying to figure out how I can programmatically configure several custom authentication realms and associate authentication through them. It seems that I can’t find what the typical login.conffile is actually analyzing (in JAAS) and how I can basically achieve the same effect programmatically.

Is this the best way to do this in the form of a proxy login module that checks which input modules exist, or is there a better way to do this?

Another way I can imagine is to find which areas of JAAS can be found through files ServiceLoader, confguration, or something along these lines, and then generate login.confand override the system property for this.

None of them look like the right way to do this.

Can someone recommend something else, maybe?

Many thanks for your help!

+3
source share

All Articles