https://github.com/cmllib/sessionverifierserver
NodeJS server for verifying a Minecraft session
https://github.com/cmllib/sessionverifierserver
Last synced: 28 days ago
JSON representation
NodeJS server for verifying a Minecraft session
- Host: GitHub
- URL: https://github.com/cmllib/sessionverifierserver
- Owner: CmlLib
- Created: 2024-01-08T12:59:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-09T05:55:48.000Z (over 2 years ago)
- Last Synced: 2025-07-07T04:08:19.451Z (11 months ago)
- Language: TypeScript
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SessionVerifierServer
verify a user's minecraft session
[node-minecraft-protocol encrypt.js](https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/src/client/encrypt.js)
[node-minecraft-protocol login.js](https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/src/server/login.js)
[node-yggdrasil](https://github.com/PrismarineJS/node-yggdrasil)
[Protocol#Login](https://wiki.vg/Protocol#Login)
[Protocol Encryption](https://wiki.vg/Protocol_Encryption)
## API
### GET /startlogin
Response
| Property | Type | Description |
|-------------|--------|---------------------------------------------------|
| serverId | string | server id |
| publicKey | string | public key formatted in DER and encoded in base64 |
| verifyToken | string | verify token encoded in base64 |
### POST /verifysecret
Request
| Property | Type | Description |
|--------------|--------|---------------------------------|
| username | string | username |
| sharedSecret | string | shared secret encoded in base64 |
Response
| Property | Type | Description |
|----------|--------|-------------|
| username | string | |
| uuid | string | |
### POST /verifytoken
Request
| Property | Type | Description |
|-------------|--------|-------------|
| accessToken | string | |
| uuid | string | |
| username | string | |
Response
| Property | Type | Description |
|----------|--------|-------------|
| username | string | |
| uuid | string | |
## Configuration
/src/config-prod.ts
```ts
import { Config } from "./config";
const prod: Config = {
port: 23333,
serverId: 'serverid',
serverKeyPem: `
-----BEGIN RSA PRIVATE KEY-----
(pem)
-----END RSA PRIVATE KEY-----`
}
export default prod;
```
| Property | Type | Description |
|--------------|--------|------------------|
| port | number | http server port |
| serverId | string | [Server ID String](https://wiki.vg/Protocol_Encryption#Server_ID_String) |
| serverKeyPem | string | RSA private key, formatted in PEM with PKCS1 padding, used for encrypting and decrypting shared secrets |