Handling API key’s securely is an important part of any application design. This article discusses what API keys are and some good Key handling practices.
You can see and manage your API key’s in your profile here.
An API key is a unique security ID that is used to identify who is accessing the API as well as a set of access rights associated with it. You can find your API key under your account Profile. These keys are generated and provided to every subscription and is how billing is accounted for and applied to an account. This means that an API key must be kept a closely guarded secret and care must be taken to protect where they are stored.
PUT https://ml.nexosis.com/v1/data/salesdata HTTP/1.1
Content-Type: application/json
accept: application/json
api-key: {your nexosis apikey here}
{redacted}
The API key must be submitted as an HTTP Header named api-key
in every request.
Each account will always have two concurrent active API keys, designated as Primary
and Secondary
. In certain situations, it may be necessary to discard one of these keys and create a new one – for example, if a developer accidently commits their Nexosis API key to a public source code repo for all the world to see. For situations like these, one or both of the API keys can be regenerated. Activating a new key will immediately supplant the old key, rendering it useless. Any program using the old revoked key will then fail with 401 Unauthorized errors from the API endpoint.
Click Regenerate
to revoke the old key and generate a new one.
In this example, assume the application is using the key named Primary Key
and you suspect it has been compromised and it needs regenerated.
Secondary Key
as this ensures it’s new and secure.Secondary Key
.Secondary Key
are functioning correctly. Once tested thoroughly, release to production.Primary Key
to make sure any unauthorized users cannot use this key to access the application.There are important thinks to keep a watch out for that should require a key to be regenerated.
REGENERATE YOUR KEY IF:
Your Nexosis API keys should be closely guarded and protected from discovery. Make a plan and automate it. Protecting secrets in an application can be challenging without proper planning. A key change-over should be simple. Here are some guiding principals that will help.