How can i insert the generated JWT into the header during login post?

I am using Spring Security with Vaadin 24. It is a pure java application without JS. It can be done easily in case of JS fetch, but I have done research in the internet and cant find a solution for Vaadin.

The corresponding JWT authentication service, filter and generation API have been prepared. I need to call that API after login button is clicked, got the JWT, put this bearer token inside the login post header, and process.

Thanks.