kasmtech / KasmVNC

Modern VNC Server and client, web based and secure
GNU General Public License v2.0
3.55k stars 316 forks source link

Custom auth #261

Closed Lioness100 closed 3 months ago

Lioness100 commented 3 months ago

Hello! Could someone let me know if the following is feasible?

I want to create a custom login page, which would eventually use the Kasm API to create a user and redirect them to a logged-in link.

My question is if there is a better way to do this? Also, can I create a custom login page on the same domain as kasm uses, maybe with some nginx magic?

Thank you so much!

Lioness100 commented 3 months ago

Sorry, I realize this should've been a discussion post. Is there any way I can migrate it there or should I just close this and make a new discussion?

mmcclaskey commented 3 months ago

Kasm Workspaces integrates with KasmVNC and handles user and session management for you and even provides centralized logging, single sign-on etc. Yes, it is possible to do all of that yourself and yes, you can use the KasmVNC api to manage kasmvnc users.

The links to the Dev API that you provided are for Kasm Workspaces, not KasmVNC. I would recommend just using Kasm Workspaces, it is free for 5 concurrent sessions and provides nearly all features for free.

If you really want to roll your own solution, here are the kasmvnc apis, https://github.com/kasmtech/KasmVNC/wiki/API

Lioness100 commented 3 months ago

I'm sorry—yes! I got confused and was meaning to use Kasm Workspaces. I'm still a bit confused about getting started with putting both Kasm Workspaces and a custom login on a single domain. Could you provide any pointers for that, or should I make an issue/discussion on the workspaces repo?

mmcclaskey commented 3 months ago

In that case, the links you provided are appropriate. With the devAPI you can do anything you want. But you would need to write your own backend middleware and front-end. The easier solution would be to use a casting session, which is our low/no code solution. It is basically a magic URL you can put on your web page as an iframe. You would want kasm to be on a subdomain to avoid CORS issues.

https://kasmweb.com/docs/latest/guide/casting.html

I can't provide much in the way of general guidance outside of providing links to our docs. If you have specific questions about something, please post your question on the workspaces issues project.

Lioness100 commented 3 months ago

Thank you! I think I'll make my own backend, because I don't want users to be able to share links once they're logged in (I assume the API login links are one-time use?). The links are appreciated, though!

Lioness100 commented 3 months ago

It seems the API login links are not one-time use... is there any way to make them so?