2017-07-12 17 views
1

DynamoDBを使用してスプリングセキュリティ認証を提供する方法を知っている人はいますか?言い換えれば、DynamoDBを使用して以下のconfigAuthenticationメソッドをどのように変換/表現しますか?DynamoDBを使用したSpringセキュリティ認証

@Autowired 
public void configAuthentication(AuthenticationManagerBuilder auth) 
throws Exception { 
    auth.jdbcAuthentication().dataSource(dataSource) 
      .usersByUsernameQuery("select username, password, enabled from appuser where username = ?") 
      .authoritiesByUsernameQuery("select username, rolename from appuser natural join user_role natural join role where username = ?;"); 
} 
+0

https://github.com/michaellavelle/spring-security-spring-data-dynamodbは正式な回答に最も近いものですが、3年後に更新されていないので懐疑的ですそのパッケージのすでにメンテナンスされているhttps://github.com/derjust/spring-data-dynamodbを既に使用していますが、JWT/Spring Securityについては何も表示されません。 –

答えて

1

何かをSpring Security認証バックエンドとして使用できます。 UserDetailsServiceインターフェイスを実装するクラスにカスタムクエリロジックを記述し、UserDetailsインターフェイスを実装するドメインオブジェクトを返す必要がありますが、そのクラスを使用できます。

あなたの構成は

myCustomDynamoDBDetailServiceUserDetailServiceを実装し、DynamoDBのからユーザー名でルックアップを行い、あなたのクラスである
@Override 
    public void configure(AuthenticationManagerBuilder auth) throws Exception { 
    auth.userDetailsService(myCustomDynamoDbDetailService); 
} 

ような何かをしたいと思います。

関連する問題