What is a secure way to store login information? I have a swing application that requires users to login to an online account, currently logging in works, but I would like to be able to store the users login information on their computer if possible. There are a few ways I have thought of to do this:
- Save the login information in a file
- Save the login information in a database
What is the best way to do this? Does Java have something built in to do this?
I decided to use the Preferences API, to store and retrieve data
http://docs.oracle.com/javase/7/docs/api/java/util/prefs/Preferences.html
Here is a rough example of the final code: