Closed mik284 closed 2 months ago
Hi, @mik284! It is not clear what do you mean by "Extend Jmix REST endpoints to require authentication."
Please attach a sample project that demonstrates the problem.
Hello, I've been working on customizing the default Jmix REST configuration to enforce authentication on most of my endpoints. During this process, I encountered an issue where the application failed to start, presenting the following error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sec_UiSecurityFilterChain' defined in class path resource [io/jmix/autoconfigure/securityflowui/SecurityFlowuiAutoConfiguration$DefaultFlowuiSecurityConfiguration.class]: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method 'securityFilterChain' threw exception with message: View 'LoginView' is not defined
I managed to resolve this issue by upgrading from Jmix version 2.2.3 to 2.3.1 and utilizing @annotations like @RestMethod, as well as allowing anonymous resource roles which had failed before. While this solution has worked for me, I'm open to exploring new or alternative approaches that might be more efficient or align better with best practices.
I'm particularly curious about any solutions that might offer improved performance, enhanced security, or better integration with Jmix's ecosystem.
If you have any concrete problem now, please let us know.
Environment
Jmix version: 2.2.3
Bug Description
I'm encountering an issue while trying to extend Jmix REST endpoints for web and mobile consumption. The application throws a BeanCreationException when creating the sec_UiSecurityFilterChain bean. The specific error message is as follows:
This error occurs because the LoginView is not defined or registered in the application, causing the security filter chain to fail during instantiation. This is problematic because my REST endpoints require authentication, and this issue prevents the application from properly initializing.
Additionally, I need to allow certain APIs to bypass authentication. This is crucial for enabling public access to specific endpoints while keeping others secure.
Steps To Reproduce
Current Behavior
Expected Behavior