I am working on a three-layer application with the server, client, and database. The client is a java fat client. I need to generate tokens(= API keys) for access to the rest API. The hash value of these tokens will be saved to the database.
Now I am struggling a bit if I should generate the token on the server or on the client-side.
Server:
- token generation is centralized
Client:
- token will not be sent across the web, only the hash
Can you give me any advice, what is the "state-of-the-art" to do this?