Not able to login with default user and password

Created project with command line: npx vaadin-create with Auth and Hilla, but after that not able to login using default user and password!

Do you get any errors?

Some more information would be helpful

hi Simon, thanks for looking into it.

I just see this login form error on submission:

“Incorrect username or password
Check that you have entered the correct username and password and try again.”

Nothing in the console log, it is clean! I am trying user/user and, admin/admin.

Try creating the project here: Create a new Vaadin app: configure views and theme

thanks Simon.

so in the first step itself I stumbled upon issue with basic project creation and I need a workaround, I am not even into it!

Is this because of any bug? or am I missing something?

Not as far as I know.

I use https://start.vaadin.com a lot

What is npx vaadin-create command?
I just created an application with npm init vaadin my-app, selecting Hilla (React + TypeScript) and Login/logout and access control feature, and I was able to login with user/user and admin/admin

thanks Marco! I will try your given command.

I tried “npx create-vaadin”, that too throwing few questions to select, with that I was able to create valid vaadin project, but then not able to login as I mentioned.

I don’t remember such npx vaadin-create command. Where did you find it? Can you provide a link?

thanks Marco for looking into this.

npx create-vaadin is the command, not vaadin-create

btw, just now I even tried your given “npm init vaadin” command, no luck! still see the same authentication error message.

image

You may try adding

logging.level.org.springframework.security=DEBUG

to application.properties and check the logs for some information

thanks again Marco!

I added your given debug properties, here is what I see now:

2024-08-31T18:47:47.064+05:30 DEBUG 19176 — [nio-8080-exec-2] o.s.security.web.FilterChainProxy : Securing POST /login
2024-08-31T18:47:47.080+05:30 DEBUG 19176 — [nio-8080-exec-2] o.s.security.web.csrf.CsrfFilter : Invalid CSRF token found for http://localhost:8080/login
2024-08-31T18:47:47.080+05:30 DEBUG 19176 — [nio-8080-exec-2] o.s.s.w.access.AccessDeniedHandlerImpl : Responding with 403 status code
2024-08-31T18:47:47.080+05:30 DEBUG 19176 — [nio-8080-exec-2] o.s.security.web.FilterChainProxy : Securing POST /error

That’s weird. Do you have customized something on the created project?
Just creating the app and running it works fine for me

When the security is enabled, it is very common to have an old CSRF token on your browser from another local test application which was deployed to http://localhost:8080.
It worth trying to browse this application in an incognito tab to see if the problem persist or not.

3 Likes

FYI, I actually had to close browsers, all tabs, as clearing cache alone was not enough, and that helped!

1 Like