wyatt-herkamp / nitro-launcher

A Minecraft Launcher in Rust using Tauri
4 stars 3 forks source link

Minecraft Authorization - Microsoft. #3

Open wyatt-herkamp opened 2 years ago

wyatt-herkamp commented 2 years ago

Implement https://wiki.vg/Microsoft_Authentication_Scheme

Requires https://github.com/tauri-apps/tauri/issues/323 to be implemented

Shotman commented 2 years ago

Since it's Minecraft specific there might be a solution without waiting for the PR to work. For Xbox Microsoft uses device codes, OAuth device flow, that generates a code you can enter in real browser on another device to login into your minecraft account. MultiMC launcher retro engeenered it so it could be possible to use that

wyatt-herkamp commented 2 years ago

Since it's Minecraft specific there might be a solution without waiting for the PR to work. For Xbox Microsoft uses device codes, OAuth device flow, that generates a code you can enter in real browser on another device to login into your minecraft account. MultiMC launcher retro engeenered it so it could be possible to use that

So the solution is going to be is to open a localhost web server. and just have the browser refer to that.

Shotman commented 2 years ago

Since it's Minecraft specific there might be a solution without waiting for the PR to work. For Xbox Microsoft uses device codes, OAuth device flow, that generates a code you can enter in real browser on another device to login into your minecraft account. MultiMC launcher retro engeenered it so it could be possible to use that

So the solution is going to be is to open a localhost web server. and just have the browser refer to that.

No need to open a localhost server at all ! Basically it goes like this : 1 - Your launcher calls the minecraft device code auth API => you get a code (like a 2FA) & a url 2 - You open a web browser (doesn't even have to be on the same device) with the URL provided in step 1 3- You input the code provided in step 1 and go through a classic auth process with email/password etc 4 - Your app is now authenticated

wyatt-herkamp commented 2 years ago

That seems weird. When I get to the point where I will need to look into auth a bit more. I hopefully understand what you are saying. I got another project I want to stabilize before I start to actually work on this project.

Shotman commented 2 years ago

https://www.c-sharpcorner.com/article/authentication-in-smart-tv-app-device-code-flow/ Here is a nice blog that explains how it works better than me ^^

Usually this method is used for devices that don't have web browsers or user friendly way to interact such as SmartTV or consoles but it can also be used as a way of login in for solutions that don't have a localhost server or deeplinking