Skip to content

Commit

Permalink
docs: Add information about authentication
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
  • Loading branch information
akrejcir committed Oct 16, 2023
1 parent 813551a commit f668bb6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ curl --header "Authorization: Bearer ${KUBERNETES_USER_TOKEN}" \
"https://${K8S_API_URL}/apis/token.kubevirt.io/v1alpha1/namespaces/${VMI_NAMESPACE}/virtualmachines/${VMI_NAME}/vnc?duration=${DURATION}"
```

The `KUBERNETES_USER_TOKEN` variable is a bearer token used to authenticate with
kubernetes API. It can be obtained using:
In this example, we use a bearer token to authenticate the user with the Kubernetes API server.
Kubernetes supports two main ways of authenticating, token and TLS client certificates, and other ways can be added
using an authenticating proxy. More information can be found in the [documentation](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authentication-strategies).

If the user is logged in using a token, then the token can be retrieved using:
```bash
KUBERNETES_USER_TOKEN=$(oc whoami -t)
```

0 comments on commit f668bb6

Please sign in to comment.