The Artima Developer Community
Sponsored Link

Java Answers Forum
login/logout using swing/java

2 replies on 1 page. Most recent reply: Feb 13, 2006 8:20 AM by Frank Sommers

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
sdinesh79

Posts: 7
Nickname: sdinesh79
Registered: Sep, 2003

login/logout using swing/java Posted: Feb 1, 2006 12:26 AM
Reply to this message Reply
Advertisement
Hi All,

I am working on a Swing application. This application should have the login and logout facility.First the user has to login using his username/password to access the facility provided by this application. In other words I need something like session in beans.

This is for security purpose so that only registered users shall access this application.

Please let me know if I am not clear.

Is it possible in Swing or is there any workaround solution ?

Note: My current idea is to write 'Y' (once a user has logged in) or it will be 'N' to a file and each time read the file to check whether a user is logged in. This is a just a suggestion of my own.

Thanks
Dinesh


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: login/logout using swing/java Posted: Feb 1, 2006 1:22 AM
Reply to this message Reply
I would not write anything into a file.

Is this a network application?
If not, just use a login and that's it.
As long as the user does not pass the login, just don't let hiim proceed.

If it IS network application, the server should use a security ticket.
If the user uses a valid login, the server sends a coded String containing the ticket (generated with random numbers for example).
Everytime the user want's to acces something, the security ticked is passed to the server.

The server on his side generates the ticket and put's it into a temporary list + information since when the user last used it. If the user didn't use it for - let's say 1 minute, send an identification reuest to the user. If the user doen't return the answer in 1 minute, then delete the ticket.
If the user logs out, just delete the ticket.
By the way: In the ticket list also note the IP from where the user logged in. Only allow access for this IP (with this ticket).

Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Re: login/logout using swing/java Posted: Feb 13, 2006 8:20 AM
Reply to this message Reply
You should probably use a more standard Java security mechanism, such as JAAS.

Flat View: This topic has 2 replies on 1 page
Topic: your advices Previous Topic   Next Topic Topic: how to execute a JAVA code through an html code

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use