How to allow requests with API KEY for client application in DJANGO without user login?
I am trying to have a global API KEY where it would be mandatory for the client application to send the API key in headers to get a successful response.
I intend to keep my APIs secure and not expose so much information to all public URLs by using IsAuthenticatedOrReadOnly.
Even after passing the API keys from the headers if someone tries to go and get it from the network it would be harmful so can anyone help me with the better approach on how we cab secure our API's
Find Below more information about what I am trying to achieve.
GET /products/ HEADERS - EMPTY
RESPONSE - PLEASE PASS THE API KEY TO ACCESS THE APIS
GET /products/ HEADERS - [API_KEY - SAMPLE]
RESPONSE - [PRO1, PRO2, PRO3, PRO4]
POST /products/ HEADERS - [API_KEY - SAMPLE]
RESPONSE - PLEASE PROVIDE AUTHENTICATION CREDENTIALS
Please Follow this article.