{"id":13993789,"url":"https://github.com/pikvm/kvmd-auth-server","last_synced_at":"2026-03-10T08:34:15.753Z","repository":{"id":38827731,"uuid":"236882912","full_name":"pikvm/kvmd-auth-server","owner":"pikvm","description":"Very basic HTTP/MySQL auth server for Pi-KVM","archived":false,"fork":false,"pushed_at":"2023-05-27T10:09:28.000Z","size":34,"stargazers_count":20,"open_issues_count":0,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-27T04:33:20.364Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pikvm.org","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pikvm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"patreon":"pikvm","custom":"https://paypal.me/pikvm"}},"created_at":"2020-01-29T01:45:29.000Z","updated_at":"2024-12-21T20:40:09.000Z","dependencies_parsed_at":"2024-01-18T04:28:11.399Z","dependency_job_id":null,"html_url":"https://github.com/pikvm/kvmd-auth-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pikvm/kvmd-auth-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikvm%2Fkvmd-auth-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikvm%2Fkvmd-auth-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikvm%2Fkvmd-auth-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikvm%2Fkvmd-auth-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pikvm","download_url":"https://codeload.github.com/pikvm/kvmd-auth-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikvm%2Fkvmd-auth-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30328251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-09T14:02:33.579Z","updated_at":"2026-03-10T08:34:15.724Z","avatar_url":"https://github.com/pikvm.png","language":"Python","funding_links":["https://patreon.com/pikvm","https://paypal.me/pikvm"],"categories":["Python"],"sub_categories":[],"readme":"# KVMD-Auth-Server\n[![CI](https://github.com/pikvm/kvmd-auth-server/workflows/CI/badge.svg)](https://github.com/pikvm/kvmd-auth-server/actions?query=workflow%3ACI)\n[![Discord](https://img.shields.io/discord/580094191938437144?logo=discord)](https://discord.gg/bpmXfz5)\n\nThis repository demonstrates the ability to organize a centralized HTTP authorization server for Pi-KVM with a single user database.\nIt's assumed that you already have a MySQL server that used to store user's credentials.\nPlease note that passwords are stored in plain text. In addition, passwords are transmitted over the network over HTTP, not HTTPS.\nThis server only demonstrates how authorization works.\nIn a real secure infrastructure we recommend that you salt passwords and hash them and configure HTTPS.\n\n-----\n# The process\n\nWhen using HTTP authorization, [KVMD](https://github.com/pikvm/kvmd) sends the following\n[JSON POST request](https://github.com/pikvm/kvmd/blob/master/kvmd/plugins/auth/http.py) to the server specified\nin the settings (for example `http://kvmauth/auth`):\n```json\n    {\n        \"user\": \"\u003cusername\u003e\",\n        \"passwd\": \"\u003cqwerty\u003e\",\n        \"secret\": \"\u003c12345\u003e\"\n    }\n```\n\nThis request contains the name of the user who wants to log in to Pi-KVM, his password, and a \"secret\" that appears in KVMD config.\nIn our case, it's used as a KVM ID in the network. Based on this secret, the server will decide whether the user is allowed access to a specific KVM.\n\n❗NOTE: Usernames needs to adhere to [a-zA-Z] as a starting character otherwise it will fail ❗\n\nIf the auth server responds with `200 OK`, KVMD will allow the user to log in.\nFor other response codes, the login will be denied.\n\n----\n# HOWTO\n1. Create MySQL database `kvm_users` and allow the `kvmauth` user access to this database.\n\n2. Create table:\n```sql\nCREATE TABLE kvm_users (\n    id INT(32) NOT NULL AUTO_INCREMENT,\n    kvm_id VARCHAR(50) NOT NULL,\n    user VARCHAR(50) NOT NULL,\n    passwd VARCHAR(60) NOT NULL,\n    PRIMARY KEY (id),\n    UNIQUE KEY user (user)\n);\n```\n\n3. Add an `example` user:\n    ```sql\n    INSERT INTO kvm_users (kvm_id, user, passwd) VALUES (\"12345\", \"example\", \"pa$$word\");\n    ```\n\n4. Clone this repo to your server:\n    ```bash\n    $ git clone https://github.com/pikvm/kvmd-auth-server\n    ```\n\n5. Edit `config.yaml`. Set DB and auth server params. It will listen `server.host` and `server.port` for upcoming requests from Pi-KVM devices.\n\n6. Run and run server:\n    ```bash\n    $ make build\n    $ make run\n    ```\n\n6. Edit `/etc/kvmd/auth.yaml` on your Pi-KVM and reboot it:\n    ```yaml\n    internal:\n        force_users: admin\n    external:\n        type: http\n        url: http://your_auth_server:port/auth\n        secret: 12345  # KVM ID\n    ````\n\n    The `admin` user will be checked through local KVM auth. Any other users will only be logged in through the auth server.\n    \n-----\n# License\nCopyright (C) 2018-2023 by Maxim Devaev mdevaev@gmail.com\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see https://www.gnu.org/licenses/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpikvm%2Fkvmd-auth-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpikvm%2Fkvmd-auth-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpikvm%2Fkvmd-auth-server/lists"}