API Key implementation on frontend
All APIs to be authenticated via header key Authorization
As of now, a single API Key for all APIs is to be used by the frontend client. In the future can implement separate keys for separate clients.
All APIs to be authenticated via header key Authorization
As of now, a single API Key for all APIs is to be used by the frontend client. In the future can implement separate keys for separate clients.
marked this issue as related to dd-code-api#27 (closed)
When this is done, a backend pull needs to be made to get the respective code running on the API server as well. Concerned commit for the api codebase is dd-code-api@56eeb5df
A new env variable API_KEY
needs to be added, which would be the actual api_key
. This key can be rotated from time-to-time to ensure security.
Could we use html header for using api_key
instead of url get parameter?
It would be nice to hide api-key
from the url string.
How do you think?
import json
import requests
api_token = 'your_api_token'
api_url_base = 'https://api.ddcode.com/v2/'
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer {0}'.format(api_token)}
changed the description
closed