Misplaced Pages

API key

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Identifier for authenticating with an API
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "API key" – news · newspapers · books · scholar · JSTOR (October 2018) (Learn how and when to remove this message)

An application programming interface (API) key is a secret unique identifier used to authenticate and authorize a user, developer, or calling program to an API.

Cloud computing providers such as Google Cloud Platform and Amazon Web Services recommend that API keys only be used to authenticate projects, rather than human users.

Usage

HTTP APIs

API keys for HTTP-based APIs can be sent in multiple ways:

In the query string:

POST /something?api_key=abcdef12345 HTTP/1.1

As a request header:

GET /something HTTP/1.1
X-API-Key: abcdef12345

As a cookie:

GET /something HTTP/1.1
Cookie: X-API-KEY=abcdef12345

Security

API keys are generally not considered secure; they are typically accessible to clients, making it easy for someone to steal an API key. Keys often have no expiration, meaning a stolen key can be used indefinitely unless revoked or regenerated. Keys are supposed to be a secret known only by the client and server, so they should not be communicated over an insecure channel and can only be considered secure when used in conjunction with other security mechanisms such as HTTPS.

There are several risk scenarios when using API keys:

These risks generally stem from the key being in plaintext, which is potentially accessible to adversaries.

Incidents

In 2017, Fallible, a Delaware-based security firm examined 16,000 Android apps and identified over 300 which contained hard-coded API keys for services like Dropbox, Twitter, and Slack.

References

  1. "API Key - What is an API Key?". Last Call - RapidAPI Blog. Retrieved 2019-09-20.
  2. ^ Lu, HongQian Karen (June 2014). Keeping Your API Keys in a Safe. IEEE 7th International Conference on Cloud Computing. doi:10.1109/CLOUD.2014.143 – via IEEE Xplore.
  3. "What is an API Key? - API Keys and Tokens Explained - AWS". Amazon Web Services, Inc. Retrieved 2024-09-01.
  4. "Why and when to use API keys | Cloud Endpoints with OpenAPI". Google Cloud. Retrieved 2024-09-01.
  5. ^ "API Keys". Archived from the original on 2019-10-17.
  6. "Why and when to use API keys | Cloud Endpoints with OpenAPI". Google Cloud. Retrieved 2019-09-20.
  7. "Hundreds of popular Android apps contain hard-coded secret keys". ZDNet. Retrieved 2022-06-20.

Book sources

External links


Stub icon

This computer-programming-related article is a stub. You can help Misplaced Pages by expanding it.

Categories: