2
我想要的oauth2支持添加到我的Java REST服務,遷移春天的OAuth分貝JDBC
我已經manged得到它在內存中的工作:
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)
謝謝
我願把令牌在db中也是如此,但這將是下一步,將它們都做得更好 – user3394220