nacos-group/nacos-plugin

nacos 2.3.0 用自定义数据库插件扩展,登录时提示找不到用户

yangm opened this issue · 2 comments

yangm commented

使用如下配置,在登录时提示找不到用户,org.springframework.security.core.userdetails.UsernameNotFoundException: User nacos not found:
spring.sql.init.platform=dm
db.num=1
db.url.0=jdbc:dm://127.0.0.1:5236/NACOS?schema=NACOS&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
db.user.0=SYSDBA
db.password.0=123456
db.pool.config.driverClassName=dm.jdbc.driver.DmDriver

调式发现 nacos-default-auth-plugin 模块下出现出错,没有对应分页实现,如果把spring.sql.init.platform=mysql就是好的,请问这块如何扩展
/**
* Get handler adapter.
*
* @param dataSourceType data source type.
* @return
*/
protected PageHandlerAdapter getHandlerAdapter(String dataSourceType) {
List handlerAdapters = PageHandlerAdapterFactory.getInstance().getHandlerAdapters();
for (PageHandlerAdapter adapter : handlerAdapters) {
if (adapter.supports(dataSourceType)) {
return adapter;
}

    }
    
    return PageHandlerAdapterFactory.getInstance().getHandlerAdapterMap()
            .get(DefaultPageHandlerAdapter.class.getName());
}

用别的数据库时候也是,nacos账户登录日志显示:
UsernameNotFoundException: User nacos not found

请问如何解决的

alibaba/nacos#11489

应该是因为这个吧