views:

20

answers:

1

I have an authenticated user with an HTTP session.

The user should be able to use an applet to connect with this authentication to a server. It will connect to server via a socket connection so looking up the session is not possible.

How can the authentication be passed?

+1  A: 

The clean way is to pass the applet some secret token and then use that to login the applet again. Try UUID.randomUUID() as the secret token. Save that plus the credentials in a map and pass it to the applet.

The applet should then call a "login" URL which expects the token and creates a new session for the same user.

Aaron Digulla
Thanks - is there a reason why the secret would be stored in a map as opposed to database storage?
Nick
You can use any kind of global variable, even one which costs $1000000/year and is labeled "Oracle" :-)
Aaron Digulla
Thanks, I've opted to store them in an object attached to the user's session.
Nick