[英]In jaas can we use an object of javax.security.auth.login.Configuration class as an alternative to LoginModule configuration using .config files
While performing JAAS authentication I do not want to use a .config file for LoginModule lookup/configuration. 在执行JAAS身份验证时,我不想使用.config文件进行LoginModule查找/配置。 My question is;
我的问题是; is there a way to do this with out using a .config file?
有没有办法在不使用.config文件的情况下执行此操作? 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
或者我们可以为此目的使用javax.security.auth.login.Configuration对象,因为在阅读Oracle javadoc后我不清楚http://docs.oracle.com/javase/8/docs/api/javax/security/auth /login/Configuration.html
Pass your Configuration at constructor of LoginContext . 在LoginContext的构造函数中传递配置 。
See JavaDoc at LoginContext : 请参阅LoginContext上的 JavaDoc:
[...]
[...]
Configuration
组态
If the constructor has a Configuration input parameter and the caller specifies a non-null Configuration, the LoginContext uses the caller-specified Configuration.
如果构造函数具有Configuration输入参数且调用者指定非空配置,则LoginContext使用调用者指定的Configuration。
[...]
[...]
public LoginContext(String name,
Subject subject,
CallbackHandler callbackHandler,
Configuration config)
throws LoginException
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.