simple server/webapp api (https://mcrealms.herokuapp.com/) for the Microsoft oauth flow integration with the minecraft realms/auth api and node wrapper for https://pc.realms.minecraft.net
due to the microsoft oauth flow differing from the mojang oauth flow, the authentication process pipeline is broken once migrating accounts
I hosted a web server/app api connected to a free azure application that makes it easy for anyone to authenticate with the new microsoft oauth flow
once the auth process is completed, you will receieve your access_token, which can be used within the mc-realms api ecosystem or the minecraft realms api ecosystem
sign in with microsoft
give permission to mc-realms azure application
if the login/authentication process is successful you will receive a payload with an access_token, which can now be used within the minecraft ecosystem to retreive account information
the access token has a lifetime of 86400 seconds (24 hours/1 earth day)
after that, you can refresh or issue yourself a new token
occasionally, pc.realms.minecraft.net will return a Retry again later response, this is typical and it just means to try again later
end user can now use mc-realms endpoints with their token
-due account migration to microsoft based authentication, any authentication with migrated accounts requires use of an azure application client id & secret
-hosting your own mc-realms server/web app requires some knowledge of microsoft azure. prior to anything below you should have an application set up and ready to be configured. you can follow instructions on how to create an azure application here
git clone https://github.com/revzim/mc-realms
yarn or npm i
copy .env.default to .env
PORT => the port you will host your server/webapp from
CLIENT_ID => your azure application client id
CLIENT_SECRET => your azure application client secret
REDIRECT_URI => a valid redirect uri for your azure application
default is http://localhost/token to emulate how the mc-realms web app works
within the context of this server, unless you are altering any of the source code, redirect uris should follow the paradigm host/token to work ootb
run dev: yarn dev || npm run dev
build: yarn build || npm run build => yarn start || npm run start
It looks like this package cannot currently obtian the IP and port of a realm. The endpoint for that on the realms API seems to have moved to /worlds/v1/$ID/join/pc. This seems like a relatively simple fix of refactoring some of the API interaction. I'd be happy to make a PR if I find the time.