djtheredstoner / devauth Goto Github PK
View Code? Open in Web Editor NEWSafely authenticate Minecraft accounts in development environments.
License: MIT License
Safely authenticate Minecraft accounts in development environments.
License: MIT License
Add a Encryption PR.
Using DevAuth-forge-legacy-0.3.jar
with forge 1.8.9.
After authenticating with oauth in a private browser session, the program exits with the following stacktrace:
Caused by: java.lang.RuntimeException: Error logging in
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.tryLogin(MicrosoftAuthProvider.java:153) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.login(MicrosoftAuthProvider.java:94) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.DevAuth.login(DevAuth.java:61) ~[DevAuth.class:?]
at me.djtheredstoner.devauth.common.DevAuth.processArguments(DevAuth.java:34) ~[DevAuth.class:?]
at me.djtheredstoner.devauth.forge.legacy.ForgeLegacyBootstrap.processArguments(ForgeLegacyBootstrap.java:8) ~[ForgeLegacyBootstrap.class:?]
at net.minecraft.client.main.Main.main(Main.java) ~[Main.class:?]
... 12 more
Caused by: java.lang.RuntimeException: Failed to get XSTS token
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.getXSTSToken(MicrosoftAuthProvider.java:318) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.oauthToMinecraft(MicrosoftAuthProvider.java:159) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.tryLogin(MicrosoftAuthProvider.java:143) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.login(MicrosoftAuthProvider.java:94) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.DevAuth.login(DevAuth.java:61) ~[DevAuth.class:?]
at me.djtheredstoner.devauth.common.DevAuth.processArguments(DevAuth.java:34) ~[DevAuth.class:?]
at me.djtheredstoner.devauth.forge.legacy.ForgeLegacyBootstrap.processArguments(ForgeLegacyBootstrap.java:8) ~[ForgeLegacyBootstrap.class:?]
at net.minecraft.client.main.Main.main(Main.java) ~[Main.class:?]
... 12 more
Caused by: java.lang.RuntimeException: Received invalid response from the server: 401 Unauthorized body: {"Identity":"0","XErr":2148916238,"Message":"","Redirect":"https://start.ui.xboxlive.com/AddChildToFamily"}
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.httpError(MicrosoftAuthProvider.java:373) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.jsonPostRequest(MicrosoftAuthProvider.java:410) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.getXSTSToken(MicrosoftAuthProvider.java:314) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.oauthToMinecraft(MicrosoftAuthProvider.java:159) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.tryLogin(MicrosoftAuthProvider.java:143) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.login(MicrosoftAuthProvider.java:94) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.DevAuth.login(DevAuth.java:61) ~[DevAuth.class:?]
at me.djtheredstoner.devauth.common.DevAuth.processArguments(DevAuth.java:34) ~[DevAuth.class:?]
at me.djtheredstoner.devauth.forge.legacy.ForgeLegacyBootstrap.processArguments(ForgeLegacyBootstrap.java:8) ~[ForgeLegacyBootstrap.class:?]
at net.minecraft.client.main.Main.main(Main.java) ~[Main.class:?]
... 12 more
Add neoforge.mods.toml
When i try running DevAuth i get: Caused by: java.lang.RuntimeException: Received bad status 400 Bad Request body: {"error":"invalid_request","error_description":"Tokens issued for the 'Single-Page Application' client-type should only be redeemed via cross-origin requests. If your client does not send the Origin header, you should register it as a 'Native' client-type instead.","correlation_id":"c523c866-18f5-4fbb-9aff-e96f6a974c7a"}
I've used both the .jar and the maven dependency, and they both have the same problem
Because legacy forge is stupid and lets you load coremods more than once (for example, from maven and from a jar).
I recently started using DevAuth for the first time and it just wouldn't create a config.toml file, nor the directory. But it wasn't throwing any errors. The only consequence was, that I couldn't use DevAuth and it always logged: 'DevAuth deisabled, not logging in!'. I tried to set the JVM properties, but cmd threw an error that therre was no base class 'devauth.enabled', the IntelliJ menu Help > Edit Custom VM Properties didn't work (I didn't try the Help > Edit Custom Properties, but I figure it wouldn't have worked aswell) and also the Run > Debug... > Edit Configurations > Environment Variables didn't help. I've never used java or the JVM before, but that was what google suggested to change the JVM properties mentioned in the README.md file.
What I had to do to get it working in the end, was to create the directory myself and configure the config.toml file like this:
defaultEnabled = true
defaultAccount = "main"
# An example mojang account
[accounts.main]
type = "microsoft"
[accounts.alt]
type = "microsoft"
I tried backtracking throught the code in the repository to find why it didn't throw any errors or created a default config(DevAuthJava l.33) but couldn't find the reason.
For my project I'm using Java 8 as a Project SDK (if that helps to find the source of the issue) and I'm on Windows 11
Im trying to add a microsoft account currently.
after signing in it says return to game. Then it fails to launch.
Using a normal microsoft account with 2fa
Tried using the already logged in quick login and logging in fully again via a private tab.
Crash log
Caused by: java.lang.NoSuchMethodError: com.google.gson.JsonArray.add(Ljava/lang/String;)V
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.getXSTSToken(MicrosoftAuthProvider.java:308) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.oauthToMinecraft(MicrosoftAuthProvider.java:159) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.tryLogin(MicrosoftAuthProvider.java:143) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.auth.MicrosoftAuthProvider.login(MicrosoftAuthProvider.java:94) ~[MicrosoftAuthProvider.class:?]
at me.djtheredstoner.devauth.common.DevAuth.login(DevAuth.java:61) ~[DevAuth.class:?]
The default config in .devauth/config.toml has a missing c
in defaultAccount
. This is very annoying considering its a small typo. Please fix
a microsoft account should be configured by default
Very cool mod and I appreciate you writing it!
I have been using in-game-account-switcher however it's rather clunky to have to select your account every launch. Would it be acceptable to add some environment variables in which the mod could look for?
Perhaps something like MINECRAFT_USERNAME
and MINECRAFT_PASSWORD
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.