Hi, When "action" is defined, it's sent post request to server but with **

Hi,

When “action” is defined, it’s sent post request to server but with empty body.

LoginForm loginForm = new LoginForm();
loginForm.setAction("/login");

Is it bug, or I did something wrong?

Regards,
Dmitry

When using the action property a post request is sent and the user credentials are part of the form data of the post. You can check that in the network tab of the browser developer tools.

Action is useful for instance if you want to integrate with spring security and have a login processing url or if you handle the login request separately.

If you just want to get the credentials to validate them in the server you can use loginForm.addLoginListener() and get the credentials from the login event.

Hope this helps

Yes, it’s exactly what I do. I using spring secutiry with Vaadin.

I already checked browser network tab, and found that body length is 0.

(tested on vaadin 12.0.6, 12.0.7 and 11.0.0)

17530482.png

You can check how it’s done in the [full stack starter with Vaadin 13 beta]
(https://vaadin.com/start/pre-release/full-stack-spring)

17530524.png

Confirm, it’s works with version: 13.0.0.beta1

Thanks for help.

I missed the part that you were testing with Vaadin 12 previously. Vaadin login relies on a new version of text field included in Vaadin 13. So just adding the dependency login won’t work out of the box.

If you want to keep using Vaadin 12 you should add the following to dependency management

<dependency>
    <groupId>org.webjars.bowergithub.vaadin</groupId>
    <artifactId>vaadin-text-field</artifactId>
    <version>2.3.2</version>
</dependency>

hi, I am trying to use LoginOverlay and this is the first time I’m gonna use this component. Can you help me how to use this using spring security 5? I tried to use the above but then I am getting this error “org.springframework.security.authentication.InternalAuthenticationServiceException: null Caused by: java.lang.NullPointerException: null
at com.template.acts.spring.security.UserDetailsServiceImpl.loadUserByUsername(UserDetailsServiceImpl.java:58)” which when I check the parameter “username” set on my loadUserbyUsername is empty. This happens during the submit. Would appreciate your help as I am still new in Vaadin. Thanks!