{"id":20993122,"url":"https://github.com/revzim/mc-realms","last_synced_at":"2025-05-14T20:33:29.703Z","repository":{"id":57293003,"uuid":"313145550","full_name":"revzim/mc-realms","owner":"revzim","description":"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","archived":false,"fork":false,"pushed_at":"2021-11-04T23:16:40.000Z","size":76,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-11T14:39:14.326Z","etag":null,"topics":["javascript","mc-realms","microsoft","minecraft","minecraft-realm","minecraft-realms","minecraft-server","node","node-wrapper","nodejs","realms"],"latest_commit_sha":null,"homepage":"https://mcrealms.herokuapp.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/revzim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-15T23:40:07.000Z","updated_at":"2023-10-23T21:34:53.000Z","dependencies_parsed_at":"2022-08-27T16:51:08.934Z","dependency_job_id":null,"html_url":"https://github.com/revzim/mc-realms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revzim%2Fmc-realms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revzim%2Fmc-realms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revzim%2Fmc-realms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revzim%2Fmc-realms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revzim","download_url":"https://codeload.github.com/revzim/mc-realms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225268334,"owners_count":17447320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["javascript","mc-realms","microsoft","minecraft","minecraft-realm","minecraft-realms","minecraft-server","node","node-wrapper","nodejs","realms"],"created_at":"2024-11-19T07:13:47.728Z","updated_at":"2024-11-19T07:13:47.811Z","avatar_url":"https://github.com/revzim.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [mc-realms repo][1] | [mc-realms server/webapp][3]\r\n- heroku hosted web server and api example to ease authentication flow with newly migrated microsoft accounts\r\n- [info][8] about the web app\r\n- (*down - free azure membership ended*)\r\n\r\n## simple server/web app and node wrapper for the [Minecraft Realms API][2]\r\n\r\n## API ENDPOINTS\r\n- all `mc-realms` api requests besides `/` require a `token` query param\r\n- optional query params:\r\n  - `version`: minecraft version (current default: 1.17.1)\r\n- `/`\r\n  - GET request =\u003e registering \u0026 granting auth to azure app\r\n  - redirects to `/token?code=\u003cCODE\u003e`\r\n    - `\u003cCODE\u003e` will be your one time use generated code by the microsoft oauth flow process\r\n- `/profile?token=\u003cTOKEN\u003e`\r\n  - GET request =\u003e user account profile\r\n- `/worlds?token=\u003cTOKEN\u003e`\r\n  - GET request =\u003e user account realms\r\n- `/userdata?token=\u003cTOKEN\u003e`\r\n  - GET request =\u003e user account profile \u0026 realm information\r\n- *`\u003cTOKEN\u003e` is your minecraft access token you either parsed or received earlier throughout the oauth flow process*\r\n- *written in a day, so expect changes.*\r\n\r\n#### *[looking for the source code pre account migration?][10]*\r\n\r\n#\r\n## IMPORTANT:\r\n### mojang =\u003e microsoft account migrations\r\n- mojang has been in the process of migrating user accounts to microsoft accounts\r\n- previous versions of this api return an error/warning detailing the account migration\r\n- migrating an account to microsoft will introduce the end user to the `microsoft oauth flow`\r\n  1. oauth code\r\n  2. oauth code =\u003e oauth token\r\n  3. oauth token =\u003e xbl auth\r\n  4. xbl auth =\u003e xsts auth\r\n  5. xsts auth =\u003e minecraft auth\r\n  6. minecraft auth =\u003e check ownership of game\r\n  7. user authenticated and can now get profile/realm/server info\r\n- the microsoft oauth flow is documented on the [wiki][4]\r\n\r\n## [mc-realms app][3]\r\n- due to the microsoft oauth flow differing from the mojang oauth flow, the authentication process pipeline is broken once migrating accounts\r\n- 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\r\n- 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\r\n  1. sign in with microsoft\r\n  2. give permission to `mc-realms` azure application\r\n  3. 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\r\n    - the access token has a lifetime of 86400 seconds (24 hours/1 earth day)\r\n    - after that, you can refresh or issue yourself a new token\r\n    - occasionally, `pc.realms.minecraft.net` will return a `Retry again later` response, this is typical and it just means to try again later\r\n  4. end user can now use mc-realms endpoints with their token\r\n  5. [API ENDPOINTS][9]\r\n\r\n## host your own\r\n### *IMPORTANT*\r\n### *-due account migration to microsoft based authentication, any authentication with migrated accounts requires use of an azure application client id \u0026 secret*\r\n### *-hosting your own mc-realms server/web app requires some knowledge of [microsoft azure][5]. 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][6]*\r\n- `git clone https://github.com/revzim/mc-realms`\r\n- `yarn` or `npm i`\r\n- copy `.env.default` to `.env`\r\n- `PORT` =\u003e the port you will host your server/webapp from\r\n- `CLIENT_ID` =\u003e your azure application client id\r\n- `CLIENT_SECRET` =\u003e your azure application client secret\r\n- `REDIRECT_URI` =\u003e a valid redirect uri for your azure application\r\n  - default is `http://localhost/token` to emulate how the [mc-realms][3] web app works\r\n  - 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\r\n- run dev: `yarn dev` || `npm run dev`\r\n- build: `yarn build` || `npm run build` =\u003e `yarn start` || `npm run start`\r\n- head to http://localhost\r\n- [API ENDPOINTS][9]\r\n\r\n\r\n### MORE DETAILS:\r\n### *-for educational purposes only*\r\n### *-very early stages development server/api source code*\r\n### *-development began 2021-10-05 and have no idea of the future of the project*\r\n\r\n\r\n## [pre account migration readme][7]\r\n- source code prior to microsoft account migration moved to [/mojang][10]\r\n\r\n\r\n\u003c!-- LINKS --\u003e\r\n[0]: https://github.com/revzim\r\n[1]: https://github.com/revzim/mc-realms\r\n[2]: https://pc.realms.minecraft.net/\r\n[3]: https://mcrealms.herokuapp.com/\r\n[4]: https://wiki.vg/Microsoft_Authentication_Scheme\r\n[5]: https://azure.microsoft.com/en-us/\r\n[6]: https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app\r\n[7]: ./README_PREMIGRATE.md\r\n[8]: #mc-realms-app\r\n[9]: #api-endpoints\r\n[10]: ./mojang/\r\n\r\n\r\n#### author\r\n* [revzim][0]\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevzim%2Fmc-realms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevzim%2Fmc-realms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevzim%2Fmc-realms/lists"}