1.8 KiB
1.8 KiB
mc-authn: Authenticator for Minecraft with Microsoft
Installation
pip install mc-authn
Usage
1. Create Azure Token
(You can follow this guide for more details)
- Sign in to the Azure Portal
- Click "Azure Active Directory" (the icon should look like Ramiel from EVA 🤔)
- Click "App registrations" on the left navigation menu
- Click "New registration" on top left
- Give it a name
- For "Supported account types," select "Personal MS accounts only"
- For "Redirect URI", select "Web" and type "http://localhost:18275"
- Now you should be in the overview page of your app!
- You should see a field "Application (client) ID", copy that somewhere
- Click "Certificates & secrets" on the left navbar
- In the "Client secrets" tab, click "New client secret"
- Give it a description
- For "Expires" select "24 months"
- Click "Add"
- There should be "Value" and "Secret ID", copy "Value"
- Write this in
~/.config/mc-auth/auth_config.yml:
ClientID: Paste the "Application (client) ID" here
ClientSecret: Paste the "Value" you copied here
2. Login!
You can now run mc-authn to login! After logging in, it will create a text file ~/.config/mc-auth/mc-token.txt containing your minecraft token.
In your start script for minecraft, add the --accessToken argument to the java line used to start minecraft:
mc-authn
export name=$(< ~/.config/mc-auth/mc-name.txt)
export uuid=$(< ~/.config/mc-auth/mc-uuid.txt)
export auth=$(< ~/.config/mc-auth/mc-token.txt)
java ... net.minecraft.client.main.Main ... \
--accessToken ${auth} \
--uuid ${uuid} \
--username ${name}
3. Start Minecraft!
You can now start minecraft!