You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The functionality should work based on an annotation applied to Controllers. Let's assume we'll call it @authenticated. Once this annotation is present on a method, we can use the application context to retrieve all routes and check if they have this annotation.
If the annotation is present, we can use an AntPathMatcher to match the path and method, and subsequently add it to the SecurityConfig.
Current Behavior
Currently, the developer must manually create a list of routes they want to authenticate. With the annotation, we propose a different approach to automate this process.
Context
This issue has added complexity to the development process, as developers need to manually manage and update the list of authenticated routes. The goal is to simplify and automate this process by introducing an annotation-based approach.
Alternatives considered include:
Manually maintaining the list of authenticated routes (current approach).
Using reflection to scan for specific method signatures or patterns.
Implementing a custom route registration mechanism.
A potential workaround is to use reflection to dynamically detect methods that require authentication, but this can be error-prone and less maintainable compared to an annotation-based solution.
The text was updated successfully, but these errors were encountered:
Expected Behavior
The functionality should work based on an annotation applied to Controllers. Let's assume we'll call it @authenticated. Once this annotation is present on a method, we can use the application context to retrieve all routes and check if they have this annotation.
If the annotation is present, we can use an AntPathMatcher to match the path and method, and subsequently add it to the SecurityConfig.
Current Behavior
Currently, the developer must manually create a list of routes they want to authenticate. With the annotation, we propose a different approach to automate this process.
Context
This issue has added complexity to the development process, as developers need to manually manage and update the list of authenticated routes. The goal is to simplify and automate this process by introducing an annotation-based approach.
Alternatives considered include:
Manually maintaining the list of authenticated routes (current approach).
Using reflection to scan for specific method signatures or patterns.
Implementing a custom route registration mechanism.
A potential workaround is to use reflection to dynamically detect methods that require authentication, but this can be error-prone and less maintainable compared to an annotation-based solution.
The text was updated successfully, but these errors were encountered: