Without any information about why you would want to install anything on a user's machine, it's a bit difficult to answer your question. In fact, it's not really clear what your question actually is.
There are many different ways to verify a user's identity. The best one depends on the scenario it is being used in. I think Joost was asking what scenario you need this script for. You had already explained what you needed the script to do. I can think of two possible scenarios:
(1) Verifying return users who registered online.
Since there are already thousands of websites (including this one) that require users to register and later verfiy their identity, just look around the web and model your system after existing ones. I can't think of any website that requires me to download and install a program that will verify my identity at a later time, and I definitely wouldn't register at a website that had such a requirement. You can make a very secure username/password system.
(2) Creating scripts on your company's website that are supposed to only be accessed by company computers.
This would be the only case where I'd find a program on the user's computer appropriate and even then I don't see why a username/password would not be sufficient. There would be no reason to create the program using Java. The program could be created using Perl, and if you needed to create an executable, just use
PAR and pp.
Since business computers are usually in an intranet, you probably wouldn't need to worry about the users having to install the program themselves. Just talk with your sysadmin and have him deploy the program to all the needed computers.