django-rest-framework-api-key icon indicating copy to clipboard operation
django-rest-framework-api-key copied to clipboard

How do we generate api key and store it? Do we store the api in the settings file of our rest service app?

Open daxbritto opened this issue 7 years ago • 6 comments

daxbritto avatar Jun 08 '17 01:06 daxbritto

Hello @daxbritto! You can create a key from the django admin. Make sure you copy it before navigating to another page as it will not show up in the admin again to prevent from being reused.

image

manosim avatar Jun 08 '17 11:06 manosim

Thanks so much! Another question to add on: Once we install the app will it mean all my Rest services for the apps will use the same api key? Is there a way where I can provide different client calling my service with different api keys?

daxbritto avatar Jun 08 '17 12:06 daxbritto

So the idea is that if you have ie. a mobile app you will create an api key for this mobile app (attach the key to the headers of each request). If you you then build another service/app you will give that another key etc etc. This is used just for precaution so that no else will be able to make requests to your web api(imagine having a registration API endpoint open to everyone!). Hope it makes sense!

manosim avatar Jun 08 '17 12:06 manosim

Hello @manosim it kinda makes sense. However the use case here is that we have multiple client talking to our 1 rest service app and we need separate api keys for each of them. Is this something possible to configure using this app?

daxbritto avatar Jun 09 '17 00:06 daxbritto

So @daxbritto you could create multiple keys for each client and give them a name?

manosim avatar Jun 09 '17 08:06 manosim

Thank u will try that...

daxbritto avatar Jun 26 '17 01:06 daxbritto