This page explains how to generate and use different tokens and keys for nRF Cloud services over REST, using the nRF Cloud portal or REST endpoints.
Some operations depend on your role within a team. Anyone can view a key or token, but not all roles can generate them.
All team members can generate API keys through the nRF Cloud portal. The API key is user-specific.
To view an existing API key or generate a new one:
Log in to the nRF Cloud portal.
Click the three-line menu in the upper right corner.
Click User Account.
On the Current Team Details card, locate the API key. You can copy the existing key, or generate a new one:
Click the icon next to the text box to copy the existing API key.
Click Regenerate API key to generate a new one.
A pop-up opens:
regenerate api keyin the text box to confirm.
- Click OK.
- The new key appears in the text box.
Use this key in the
Authorization: Bearer header in REST requests that require it. Previously issued API keys are valid for up to 60 minutes after you generate a new one.
The evaluation token is the only JWT that you can generate through the nRF Cloud portal. To generate a commercial token, see JWT authentication on nRF Cloud.
To use Location Services, you must generate a JWT for each service, using the relevant service key for each.
Only the team owner can generate an evaluation token, through the nRF Cloud portal or directly through the APIs.
All team members can view the evaluation token from the Team page in the portal or using the APIs.
To generate the evaluation token in the portal (owner only):
- Log in to the nRF Cloud portal.
- Click the drop-down menu in the top right corner.
- Click Team.
- In the Service Evaluation Token section, click Generate Token. A window opens asking for confirmation.
- Click OK to generate the token.
- Copy the token that appears in the text field to the left of the Generate Token button. The token no longer appears once it has expired.
To generate the evaluation token using the REST API (owner only):
- Call the
To view the evaluation token:
- View the token and its expiration date at any time using the
Service keys apply to proxy server use of Location Services and require a Pro or Enterprise plan.
Only the team owner can generate service keys.
To use service keys, you must first declare proxy server usage on your Manage plan page.
To generate service keys:
Log in to the nRF Cloud portal.
In the left sidebar, click Device Management.
A panel opens to the right.
Click Manage Service Keys.
The service key page opens. There is a card for each service that requires a key.
Click Generate New Key for the desired service.
generate new keyin the text box to confirm.
The server generates and shows the key. Creating a new service key invalidates JWTs signed with the old one.
Copy and store the key in a secure place by selecting and copying the text, or by clicking the icon below the text box. If you lose the key or it is compromised, you will need to generate a new key.
Repeat these steps for other services as needed.
Once you generate a new service key, you also need to generate a new JWT for each service, signed with the relevant service key.