Spring security 使用DynamoDB的Spring安全认证

Spring security 使用DynamoDB的Spring安全认证,spring-security,amazon-dynamodb,Spring Security,Amazon Dynamodb,有人知道如何使用DynamoDB提供spring安全认证吗?换句话说,您将如何使用DynamoDB转换/表示以下configAuthentication方法 @Autowired public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication().dataSource(dataSource) .usersB

有人知道如何使用
DynamoDB
提供spring安全认证吗?换句话说,您将如何使用
DynamoDB
转换/表示以下
configAuthentication
方法

@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 = ?;");
}

您可以使用任何东西作为Spring安全认证后端。您需要在实现
UserDetailsService
接口的类中编写自定义查询逻辑,并返回实现
UserDetails
接口的域对象,但您可以使用该类

您的配置将类似于

  @Override
  public void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(myCustomDynamoDbDetailService);
}
其中,
myCustomDynamoDBDetailService
是您的类,它实现了
UserDetailService
,并从DynamoDB通过用户名进行查找。

是我发现的最接近官方答案的,但它已经三年没有更新过了,所以我对该包持怀疑态度。您已经在使用当前维护的,但我没有看到关于JWT/Spring安全性的任何内容。