Kevy Kibbz
Kevy Kibbz

Reputation: 39

How to create an API secured by api key

I'm trying to create a RESTful API using django-rest-framework and I'm unable to secure it with access key, How can I go about it?

Upvotes: 2

Views: 591

Answers (2)

Ersain
Ersain

Reputation: 1520

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

Upvotes: 0

PleSo
PleSo

Reputation: 354

You can use JWT Authentication to achieve that.

Upvotes: 0

Related Questions