Recent Discussions

Server Management Protocol API auth

Unanswered
Barbary Lion posted this in #questions
Messages28 messages
Views0 views
Barbary LionOP
As of 25w37a, the Server Management Protocol API requires the client to supply an Authorization bearer token header with a server specific secret.

I have obtained the server secret, but I cannot seem to establish a connection without it dropping. How do I correctly supply the secret?
Screenshot_2025-09-29_145808.png
Barbary LionOP
I should note that my code works in the previous snapshot without the need for auth, so I think the problem is I am trying to authorize incorrectly.
Barbary LionOP
I am writing a discord bot. It's typescript
interesting
Barbary LionOP
I am trying to connect to my server's management api, but I am unsure how to authorize the client connection thats required as of 25w37a
When they first released the api there were a couple people experimenting with it but I have not found any examples since they've added auth
Barbary LionOP
How did you do your auth?
Yakutian Laika
if it helps, this is how i connected via wscat


wscat -c ws://localhost:6969 -H "Authorization: Bearer (40chartokengoeshere)"
auth token has to be 40 char
Barbary LionOP
yea mine is 40, I think it needs a different header format or something
Yakutian Laika
i believe it has to be "bearer"
im not too versed in this but the command works for me
@Yakutian Laika i believe it has to be "bearer"
Barbary LionOP
Screenshot_2025-09-29_151816.png
this actually worked lmao
literally just put Bearer in front of the key and it works
@Barbary Lion literally just put Bearer in front of the key and it works
Yakutian Laika
yeah i have no clue how it works
but thats what it needs i guess :p
I cant wait to actually utilize this come 1.21.9
Barbary LionOP
same, working on it early because the update releases tmrw
@Barbary Lion same, working on it early because the update releases tmrw
Yakutian Laika
What are your plans with it?
Barbary LionOP
I currently have a discord bot that can start/stop my minecraft server. I am going to modify it to connect to the api and announce when a player joins and leaves in a text channel. And if I feel motivated I will add extra functionality for more of the api calls.
Using the api I could track the list of current players and display it in an embed in discord
Loading...