1 of 1 people found this helpful
What is your stack? Seam, jboss, etc...
If login-config.xml is on the classpath you can simply read it as an inputstream like
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("login-config.xml");
If you use Seam solder, you can inject ResourceLoader. See Solder docs. Don't forget to mark this as answered if it answered your question.
Thanks for prompt response, Iam using jboss,and initializing login-config.xml at server startup with ldap credentials as JAAS.once I entered in to the app server (Middle Tier), I don't want to write code again to connect ldap. I want to use same credentials which were mentioned in login-config.xml.
If you configured jboss security correctly you should be able to use security client in any part of your code. See this http://www.coderanch.com/t/475883/JBoss/Configuring-application-policy-login-config