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

调用AuthenticateAsync()时报错 #4

Open
EasyColorful666 opened this issue Dec 28, 2024 · 2 comments
Open

调用AuthenticateAsync()时报错 #4

EasyColorful666 opened this issue Dec 28, 2024 · 2 comments

Comments

@EasyColorful666
Copy link

EasyColorful666 commented Dec 28, 2024

Flurl.Http.FlurlHttpException:“Call failed with status code 403 (Forbidden): POST https://api.minecraftservices.com/authentication/login_with_xbox”
代码:
private async void AuthenticateMicrosoftAsync()
{

            MicrosoftAuthenticator authenticator = new("f4c1c237-e68f-4866-a998-82f0db041c55");
            await authenticator.DeviceFlowAuthAsync(dc =>
            {
                Growl.Success("设备代码: " + dc.UserCode + " 设备代码已写入剪贴板");
                string textToCopy = dc.UserCode;

                Clipboard.SetText(textToCopy, TextDataFormat.UnicodeText);
                Clipboard.Flush();
                Process.Start(new ProcessStartInfo { UseShellExecute = true, FileName = dc.VerificationUrl });
            });

            var userProfile = await authenticator.AuthenticateAsync();
            Accounts.Add(userProfile.Name + " (Microsoft)");
        
    }
@EasyColorful666 EasyColorful666 changed the title 调用Microsoft验证时报错 调用AuthenticateAsync()时报错 Dec 28, 2024
@YangSpring114
Copy link
Member

请先检查你的 ClientId 是否通过 mojang 的申请,如果通过了还是这个问题可以贴上错误堆栈,我会尝试修

@EasyColorful666
Copy link
Author

EasyColorful666 commented Jan 4, 2025

谢谢,我试试吧

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

2 participants