【发布时间】:2015-09-18 03:22:09
【问题描述】:
我按照 this 和 this 教程创建了一个带有基于 Java 的后端的 Angular.JS 应用程序的骨架。它的代码可以在here找到。
它具有身份验证 - 在启动时 Spring Boot 会向控制台写入一个随机密码,您可以使用该密码登录到启动的应用程序。用户名为user,密码一开始就打印在控制台中:
现在我想拥有几个具有固定密码的用户帐户(没关系,如果它们是硬编码的)。
如何在该应用程序中执行此操作而不破坏与 AngularJS 的兼容性?
我想我必须在UiApplication 中修改SecurityConfiguration 并使用类似的东西
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.withUser("user")
.password("password")
.roles("USER");
}
正如here 解释的那样,但我不确定它不会破坏 AngularJS。
【问题讨论】:
标签: java angularjs spring-security spring-boot