Saska
Saska

Reputation: 1021

authentication valid user

Java EE.

Ok, JSP form handed to servlet username and password. Username and password is vaild.

How i can AUTHenticate the user?

Thanks for help.

Upvotes: 0

Views: 331

Answers (2)

Puce
Puce

Reputation: 38122

Here is the tutorial: http://download.oracle.com/javaee/6/tutorial/doc/bncas.html

Don't reinvent the wheel - especially not security, as it is hard enough to get it right even when using existing frameworks.

Upvotes: 2

lukastymo
lukastymo

Reputation: 26799

I don't know what exacly problem you have. Try this steps:

  1. Submit your form in HTTP GET to your LoginServlet
  2. Get Login
  3. Get Password
  4. If Login && Password are correct create some UserObject and call httpRequest.getSession() which get user http session. Then put this object to your created session.
  5. To check if user is logged you check if userObject exists in session

If you will have problems try attached your current sources.

Upvotes: 1

Related Questions