Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add information about authentication #34

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ 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 authentication, token and TLS client certificates.
Additional methods can be configured using the authenticating proxy.
More information is 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)
```