formatting api key content

This commit is contained in:
Mark Bishop
2018-06-08 13:45:42 -07:00
parent 3e9ccdf908
commit d085c7ebc0
2 changed files with 34 additions and 19 deletions
@@ -4,22 +4,12 @@ weight: 2400
draft: true
---
## API Keys
Some users may want to access their Rancher clusters and projects through the Rancher API. Before you can access Rancher through the API, you must generate API keys so that you can authenticate with Rancher externally.
Access to the Rancher API requires API keys. You need to first obtain API keys before you can use the Rancher CLI or write a program to call the Rancher API.
Before you can use the Rancher CLI or write a program that calls the Rancher API, you must obtain API keys using the Rancher UI.
### API Keys and User Authentication
After loggin in, authenticated user can generate API keys for accessing Rancher later on. API keys are typically assigned to an application or a project. It is safer to distribute API keys than passwords. The user can revoke access by deleting the API key.
After logging into Rancher, you can generate API keys for accessing Rancher externally using your user settings. Typically, you should assign API keys to an application or a project. Using API keys for authentication is more secure than using passwords. If you need to revoke access to the Rancher API, you can delete the API key.
### API Key Creation
You can create an API key from the UI by clicking the user icon on the top right corner and selecting the "API & Keys" menu item.
1. Click the "Add Key" button on the top of the page.
2. Provide a description of the API key and select an expiration period. For maximum security select as short an expiration period as possible.
3. Click "Create" and you will see the API endpoint, access key, secret key, and the bearer token printed on the screen. Bearer token is simply a concatenation of access key and secret key. You need to take note of the information on this screen. Once the screen is dismissed, you will not be able to recover the tokens and keys.
### Delete API Keys
A good practice is to set expiration period as short as possible. You can always delete API keys you no longer need or have been compromised.
For instructions on how to create an API key, see [Creating an API Key]({{< baseurl >}}/rancher/v2.x/en/tasks/miscellaneous/).
@@ -1,14 +1,39 @@
---
title: Miscellaneous
title: Miscellaneous Tasks
weight: 3725
draft: true
---
Coming Soon
<!-- Coming Soon
## Deleting a Node Template
Coming Soon
Coming Soon -->
## Creating an API Key
Because sometimes there's just no logical place `¯\_(ツ)_/¯`.
Coming Soon
### Creating an API Key
Create a Rancher API key so that other applications can make requests to the Rancher API. You can create API keys using the Rancher UI.
1. From any Rancher view, select **User Avatar** > **API & Keys** from the menu on the upper-right.
2. Click **Add Key**.
3. **Optional:** Enter a description for the API key and select an expiration period.
Shorter expiration periods are more secure.
4. Click **Create**.
**Step Result:** Your API Key is created. Your API **Endpoint**, **Access Key**, **Secret Key**, and **Bearer Token** are displayed. The **Bearer Token** is your **Access Key** and **Secret Key** concatenated together.
5. Copy the information displayed to a secure location. This information is only displayed once, so if you lose your key, you'll have to make a new one.
### Deleting API Keys
As a security best practice, we recommend using the minimum viable expiration period. You should delete API keys:
- That have expired.
- That may have been compromised.
To delete an API, select the stale key and click **Delete**.