【发布时间】:2015-07-02 08:19:32
【问题描述】:
我正在尝试将 oauth2 支持添加到我的 java rest 服务中,
我已经设法让它在内存中工作:
protected static class MyAuthorizationServerConfigurerAdapter extends
AuthorizationServerConfigurerAdapter {
...
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients
.inMemory()
.withClient("myapp")
.authorizedGrantTypes("password", "refresh_token")
.authorities("USER")
.scopes("read", "write")
.resourceIds(RESOURCE_ID)
.secret("mysecret");
}
...
}
问题,每次服务器重启时数据库都会丢失。 所以我想将它和现有的独立 SQL 数据库连接起来,有什么想法或指导如何完成吗?
我发现有一个 jdbc 选项,但我找不到让它工作的方法
clients.jdbc(dataSource)
谢谢
【问题讨论】: