【发布时间】:2018-07-26 03:30:24
【问题描述】:
我想使用 oauth2 实现 Rest api 安全性,我已经按照 this 使用静态用户数据实现了这种安全性。现在我想更改这种情况以使用 jdbc 对数据库中的数据进行身份验证,但直到现在我无法找到任何有关 jdbc 身份验证的教程。请给我一些我的要求示例,我的要求是 Spring mvc Rest api+OAuth2+jdbc database+java-config 示例。
目前我已经用下面的静态用户进行了测试。
public void globalUserDetails(AuthenticationManagerBuilder auth) throws
Exception {
auth.inMemoryAuthentication()
.withUser("crmadmin").password("crmpass").roles("ADMIN","USER").and()
.withUser("crmuser").password("pass123").roles("USER");
}
【问题讨论】:
标签: oauth-2.0 spring-jdbc spring-restcontroller