How to extend CdiVaadinServlet in 15/16

I am trying to port a 14 compatible CDI app to npm mode or whatever it is called. I encountered several problems where the Polymer templates just wouldn’t render in 14.2 (due to issues between RichTextEditor and vaadin-core and others) so I tried moving to 16.rc1. The templates now render just fine, however the web.xml security constraints seem to be ignored by 16. So I decided maybe its time to upgrade my security to using Jee/Jakarta 8 Security API.

From what I can understand I need to add the annotations: @FormAuthenticationMechanismDefinition & @DatabaseIdentityStoreDefinition onto the WebServlet. The Vaadin documentation mentions that there are special CDI helpers for security, however I can’t find anything on the topic.

I tried extending CdiVaadinServlet according to the current 16 documentation and adding the security annotations there, however this is just ignored and never instantiates.

Does anyone know how/if it is possible to extend the default CDI Servlet in Vaadin 15/16.

Polymer templates just wouldn’t render in 14.2 (due to issues between RichTextEditor and vaadin-core and others)

There is a workaround to this problem. Just add dependency to vaadin-confirm-dialog-flow in your pom.xml. It should allow you to stay on Vaadin 14.2+ track.