我有一个正在运行的 springmvc 和在 IBM Liberty 配置文件上运行的 spring security Web 应用程序。我使用 java config 来设置所有内容(并且没有 web.xml)。
扩展 WebSecurityConfigurerAdapter 类,我设置了简单的用户列表,如下所示:
@Autowired
public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("bill").password("123456").roles("USER");
}
Run Code Online (Sandbox Code Playgroud)
我不想在代码中包含用户信息,因此我想将用户注册表移动到 IBM Liberty Profile 服务器的 server.xml 中。
<basicRegistry>
<user name="bill" password="123456"/>
</basicRegistry>
Run Code Online (Sandbox Code Playgroud)
我该如何配置这个?
额外信息 我使用一个多模块 Maven 项目,带有一个 Ear 和一个 war 模块。所以在 server.xml 中最后一行是
<enterpriseApplication id="hellospringEAR" location="hellospringEAR-00.00.0001-SNAPSHOT.ear" name="hellospringEAR"/>
Run Code Online (Sandbox Code Playgroud)
非常感谢任何提示或建议。