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

[release-v0.3] fix: example-client: Token in subprotocol needs to be in base64 #30

Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions example-client/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Example VNC client

**This example client currently does not work. It will be fixed in the future.**

This directory contains an example page that uses noVNC library
to connect to the `vn-console-proxy` running on a cluster.
to connect to the `VMI/vnc` endpoint using a token.

A simple server with this page can be started by:
```bash
Expand All @@ -15,7 +13,7 @@ The client page takes these URL parameters:
- `port` - Port for kubevirt API. For CRC it will be `6443`.
- `namspace` - Namespace where the VM is.
- `name` - Name of the VM.
- `token` - Token generated using the `/token` endpoint.
- `token` - Token returned by `vm-console-proxy`.

For example, the following URL will point the client to a VM after substituting variables:
```
Expand Down
3 changes: 2 additions & 1 deletion example-client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@
url,
{
wsProtocols: [
"base64url.bearer.authorization.k8s.io." + vncToken,
// The token needs to be base64 encoded
"base64url.bearer.authorization.k8s.io." + btoa(vncToken),
"base64.binary.k8s.io"
]
}
Expand Down