Here we need to find a mechanism on how to generate an api key and store it in a database in encrypted value and all requests to the api need to pass as a header called API_KEY and this value will be compared with what we have in our database and if this matches then only we will allow the access to the api call
is there any best approach/suggestions to solve this in java might be using spring security or jwt token or any mechanism please suggest and would be highly appreciate for this help. any example or sample code snippet would be helpful.
Maybe you could use PBKDF2? The popular Django framework uses that.
https://en.wikipedia.org/wiki/PBKDF2