I need to generate an API key for my webservice. Can anyone suggest idea for that? Users who use my webservice should have an API key.
Asked
Active
Viewed 2,689 times
0
-
generate a key based on some random string and store it in an access table. – DevZer0 Jul 01 '13 at 07:50
1 Answers
1
You might consider implementing OAuth2's client_credentials.
I am suggesting OAuth2 so that at least you are not home cooking yet another solution.
Try looking at the posts and urls below for reference.
https://github.com/applicake/doorkeeper/wiki/Client-Credentials-flow
Understanding OAuth2 Client credentials flow
Securing a REST API written in PHP with OAuth2 client credentials flow
If all you care about is the exact mechanics involved in generating the key, consult this post that is doing in C# but the concept is language agnostic.