Do you know if it is possible to authenticate directly with the authenti

Do you know if it is possible to authenticate directly with the authenticationManager, witouth making a request to the /login path or similar?

I have a use case where I retrieve the authtoken through a call to a js service, I'd like to set the authentication straight away. The issue is that at every request I lose the authentication, I guess due to the way vaadin manages the authentication cookie

Sounds like mainly a Spring Security configuration issue.

The `SecurityContext` (incl. the `Authentication`) is stored in the HTTP session via `SecurityContextRepository#saveContext(...)` during the authentication mechanisms Spring Security provides. I generally wouldn't suggest doing that manually, but instead use/extend what's already there (like a `AbstractAuthenticationProcessingFilter` or `AbstractPreAuthenticatedProcessingFilter`).

Anyway, if you're just setting the `Authentication` via the `SecurityContextHolder` it's lost after the request.

But it's not very clear how exactly you're planing to authenticate the user. Where do you call that "js service" currently?