Home > database >  How can i use django rest framework to create an API that is secured using api key
How can i use django rest framework to create an API that is secured using api key

Time:04-13

Am trying to create a RESTful API in django using django rest-framework and am unable to secure it with access key and.How do i go about it.please help

CodePudding user response:

You can use JWT Authentication to achieve that.

CodePudding user response:

Depending on your needs, you can use built-in Django Rest Framework token authentication, as stated here, this will create non-expiring tokens in database that can be used as API keys in your case. However, if you don't want to store them at database and set your custom expiration periods for your tokens, I suggest you using simplejwt library for Django Rest Framework

  • Related