Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft Login support? #232

Closed
JoLoZ opened this issue Feb 14, 2022 · 5 comments
Closed

Microsoft Login support? #232

JoLoZ opened this issue Feb 14, 2022 · 5 comments

Comments

@JoLoZ
Copy link

JoLoZ commented Feb 14, 2022

I might just be blind, but is there any way to log users in using the new Microsoft login system?
I didn't find anything in the docs about it.

@bluefoxy009
Copy link

You'll have to implement it yourself, I recommend reading https://wiki.vg/Microsoft_Authentication_Scheme

@ci010 ci010 pinned this issue Feb 15, 2022
@ci010
Copy link
Collaborator

ci010 commented Feb 15, 2022

Great question. I'm really wondering should I put anything to this repo about the Microsoft login, as the ideal process required developer to have an individual azure application.

I can describe the general process here, and you can see the overall implementation here

First you need to register an azure app:

  1. Go azure portal, register an azure account and go "Active Directory"
  2. Find App registrations on side bar
  3. Register an app there, and get the application (client) ID

Then you need to implement oauth in your launcher. I suggest you to use @azure/msal-node.

  1. Acquire Microsoft token (see here)
    • This is done by the public oauth client. (See the public client described in @azure/msal-node)
    • This requires your launcher open browser to login Microsoft, and callback to launcher
    • In my implementation, it calls back to my website, and my website calls back to my launcher via custom protocol xmcl:// (register by electron)
  2. Acquire Xbox token (see here)
    • This is also oauth like process... but it's auth to Xbox service... See the wiki.vg or my implementation...
  3. Login Minecraft with Xbox token you just get (see here)
    • You will get our access token here... finally...
  4. Check game ownership and user game profile.
    • You can find source code in the rest of the method

As you see, the process is complex and I'm not sure if this is a general way to implement this.

Should I integrate this into the library?

@Pixelwarp
Copy link

@ci010 yes

@olliedean
Copy link

olliedean commented Sep 8, 2022

Could use this library for context: dommilosz/minecraft-auth

@ci010
Copy link
Collaborator

ci010 commented Apr 13, 2023

@olliedean @Pixelwarp see user module new instruction. It grabs part of the MS authentication.

@ci010 ci010 closed this as completed Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants