• Post Reply Bookmark Topic Watch Topic
  • New Topic

User Authentication and login System in JAVA  RSS feed

 
damodar kumar
Ranch Hand
Posts: 77
Android Chrome MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.. I'm given a task to write a user authentication and login system in java. How do I start? I can write a simple login page asking for username and password and then check them in a servlet against a database. Is this a 'User authentication and Login system'? Also I can use JAAS.but i think JAAS is already an authentication service. But I want to write from scratch. Please tell me where do i start and what exactly i need to do?

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to servlets for now.

What *exactly* you need to do depends on your requirements, your environment, what you already have, etc. We wouldn't tell you *exactly* what to do anyway, because JavaRanch is NotACodeMill :) But you already seem to know you need to check credentials against a database--what else do you need to know?
 
damodar kumar
Ranch Hand
Posts: 77
Android Chrome MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im building a application from scartch using following technologies

java
struts 1.1
hibernate

so i need a api which authenticate the user login
Please tell me where do i start and what exactly i need to do?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you begin a new project with Struts 1.1?! It is old, out-of-date, and not up to today's development standards. Bad idea.

But again--what exactly do you need to know? You already summarized the problem: you need to look up a user by id/password and see if it exists. You'd do that in a logon action. If it doesn't exist, they're not logged in. If they're not logged in, your custom Struts request processor (those might actually only be in Struts 1.2, I haven't used 1.1 in *years*) would check every action that needs to be protected to see if there's a valid user in the session. If there isn't, redirect to a login or error page.

What *precisely* do you not know how to do?
 
damodar kumar
Ranch Hand
Posts: 77
Android Chrome MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Davis,

I got the answer.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!