While performing JAAS authentication I do not want to use a .config file for LoginModule lookup/configuration. My question is; is there a way to do this with out using a .config file? or can we use javax.security.auth.login.Configuration object for this purpose because it not clear to me after reading Oracle javadoc http://docs.oracle.com/javase/8/docs/api/javax/security/auth/login/Configuration.html
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Pass your Configuration at constructor of LoginContext.
See JavaDoc at LoginContext:
[...]
Configuration
If the constructor has a Configuration input parameter and the caller specifies a non-null Configuration, the LoginContext uses the caller-specified Configuration.
[...]
public LoginContext(String name,
Subject subject,
CallbackHandler callbackHandler,
Configuration config)
throws LoginException