Frage

We have to design a simple web application. We have a simple user model class with a username, password and email. Now we want to add some SIMPLE security to this login. I have read a few things about cookies, tokens and servletfilters, but I have no idea what to do concretely.

Basically what we want is: -> Somehow keep track of a logged in user through our application.

It is written in java with spring-hibernate, the user is stored in a mysql database. When a user logs in we check if the user that has been retrieved matches the password that has been typed in.

So if someone could point us to a simple tutorial where we can implement a simple thing liek this, it'd be greatly aprpeciated.

War es hilfreich?

Lösung

Instead of implementing something on your own, try using an existing and proven solution like spring security, adding a simple user login form and remember me functionality is a matter of configuration in your context XML, Try this tutorial.

If you need an alternative then you could also use Apache Shiro.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top