简体   繁体   English

在jaas中我们可以使用javax.security.auth.login.Configuration类的对象作为使用.config文件的LoginModule配置的替代方法

[英]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:

[...] [...]

  1. 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.

相关问题 Jaas / Kerberos:在配置文件中以外的其他位置指定LoginModule - Jaas/Kerberos : specify LoginModule elsewhere than in the configuration file 将HttpServletRequest会话中的自定义对象投射到自定义javax.security.auth.spi.LoginModule中的其他自定义对象 - Casting Custom Object from HttpServletRequest session to other custom object in custom javax.security.auth.spi.LoginModule Tomcat上的JAAS登录配置错误。 无法删除JAAS配置文件 - JAAS login configuration error on Tomcat. Unable to loas JAAS config file Java:通过JAAS使用Kerberos LoginModule - Java: Using Kerberos LoginModule with JAAS JavaEE 6中的JAAS配置和LDAP登录模块 - JAAS configuration and LDAP login module in JavaEE 6 无法找到LoginModule类:com.sun.security.auth.module.Krb5LoginModule - Unable to find LoginModule class: com.sun.security.auth.module.Krb5LoginModule JAAS如何加载实现LoginModule的类? - How does JAAS load a class implementing LoginModule? JAAS-如何在LoginModule之外检索主题? - JAAS - How can the Subject be retrieved outside of the LoginModule? 验证Spring Security Java配置 - auth Spring security java configuration 在同一配置 Spring Security 中使用 RequestHeaderRequestMatcher 和 antmactcher basic auth - Use RequestHeaderRequestMatcher and antmactcher basic auth in the same configuration Spring Security
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM