vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
906 stars 57 forks source link

How do I configure SQL authentication data sources for Spring Security? #2307

Closed Yue-plus closed 1 month ago

Yue-plus commented 5 months ago

How do I configure SQL authentication data sources for Spring Security? 如何为 Spring Security 配置 SQL 认证数据源?

I saw in the documentation that it mentioned the need to override the configure(AuthenticationManagerBuilder auth) method in the VaadinWebSecurity configuration class, but I did not find this method in Hilla 2.5.7. 我看到了 文档 中提到了需要重写 VaadinWebSecurity 配置类中的 configure(AuthenticationManagerBuilder auth) 方法,但是我在 Hilla 2.5.7 中没有找到该方法。

image

Yue-plus commented 5 months ago

I followed the documentation to create a new project and tried to authentication with Spring Security. 我按照 文档 新建了一个项目,并试着使用 Spring Security 进行身份验证。

Why does the client not have permission to call getUserInfo()? 为什么在客户端没有权限调用 getUserInfo()

image image

platosha commented 1 month ago

As seen from the screenshots, the user isn't authenticated yet, and the getUserInfo() endpoint does not allow anonymous access, so it is correctly responding with the 401 error.

There has been a related issue fixed around handling this error from the Hilla auth side, see #2237.

Otherwise this seems to work as expected.