0

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.

Moo-Juice
  • 38,257
  • 10
  • 78
  • 128
Dhivya
  • 17
  • 1
  • 6

1 Answers1

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.

how to generate OAuth client identifier and client secret?

Community
  • 1
  • 1
Boon
  • 1,871
  • 1
  • 21
  • 31