Now that worked for the method level, but failed when I added the annotation at the controller level.

My code:

Code:
            HandlerMethod handlerMethod = (HandlerMethod) handler;

            if (handlerMethod != null) {
                //Object bean = handlerMethod.getBean();
                Method method = handlerMethod.getMethod();
                if (method != null) {
                    AuthenticationRequired authenticationRequiredAnnotation = AnnotationUtils.findAnnotation(method, AuthenticationRequired.class);
                    if (authenticationRequiredAnnotation != null) {
                        requiresAuthentication = true;
                    }
                }
            }