Re: RMI Login and Threads
On Apr 15, 2:32 am, "HeidiWeber" <heidi.we...@arcor.de> wrote:
Hallo
i=B4m new to RMI. I=B4ve made the RMI Tutorial from SUN. I have first 2
questions:
1)
If more clients connect to the server. Becomes every client
automaticaly his own thread thread? Or must i implement "thread
programming"?
2)
I want to realise user autentification by ID and Password. Is there a
"simple" solution for this problem - perhabs a tutorial? Or how can i
do this? How can i ensure the methods, the whole server?
Best regards
cu
Heidi
Hello Heidi, (That's my Wife's name too)
With RMI, the threads are created and handled automatically for you,
but you must be aware that your methods might be called by several
threads, and handle them accordingly. I suggest reading "Java
Concurrency in Practice" <http://www.javaconcurrencyinpractice.com/>
to learn about the proper ways to handle this.
For your second question, this is no "simple" answer... This is also a
broad topic.
First, you have to store the user id and password. Preferibly storing
the password in a one-way-function encrypted form.
Second, you *should* try to ensure that the password (in either its
original or encrypted form) is never sent through clear-text. SSL is
often the appropriate choice.
Third, You have to keep track of authenticated sessions.
I hope this helps,
Daniel.