I have created the Authentication Server using Java.. I want to know how should I store the credentials of the users in my server so that I can perform the Authentication in the fastest and the best way.
Asked
Active
Viewed 138 times
0
-
What did your research tell you? – Fildor Jun 05 '13 at 09:34
-
I searched on internet and found some solution related to indexing.. but didnt find too useful.. I am confused which data structure should I use – Mitaksh Gupta Jun 05 '13 at 09:37
-
We need more detail. Will the AuthServer be provided with String userNames? Oder numeric ids? ... Are you expecting 10 auths/s or more like a million/s ... Are you planning on using some DB like Redis or others? How many Credentials is the server expected to hold overall? – Fildor Jun 05 '13 at 10:29
-
Did you see the answer below? Was it helpful? – Michael Jun 06 '13 at 10:02
-
@Michael thanks for your answer.. actually I made this authentication for testing purpose using sun libraries in java . I created this to create a unit test for my login controller. – Mitaksh Gupta Jun 06 '13 at 10:28
-
It was not clear from you question – Michael Jun 06 '13 at 10:35
-
yeah I forgot to mention testing part.. will do so now.. – Mitaksh Gupta Jun 06 '13 at 10:38
1 Answers
0
- Store a user name as the plain text.
- Store a user password in the hashed way using SA256 or SHA512
- For each user generate salt that will be used for hashing of the password for the user and store it in DB (each user has its own salt).
During authentication hash the password that you get from a user in the plain text using the same salt and compare to the stored password.

Michael
- 10,063
- 18
- 65
- 104