yushijinhun / authlib-injector

Build your own Minecraft authentication system.
https://authlib-injector.yushi.moe
GNU Affero General Public License v3.0
744 stars 67 forks source link

custom service #131

Closed EvilToasterDBU closed 3 years ago

EvilToasterDBU commented 3 years ago

I tried to make a proxy for the minesocial.net system based on this developments, the result is: [authlib-injector] [ERROR] Unrecognized proxy URL: minesocial.eviltoaster.workers.dev Run command: -javaagent:authlib-injector.jar -Dauthlibinjector.mojangProxy=minesocial.eviltoaster.workers.dev -jar mohist.jar Help me please.

EvilToasterDBU commented 3 years ago

I i use -javaagent:authlib-injector.jar=minesocial.eviltoaster.workers.dev -jar mohist.jar result [authlib-injector] [INFO] Authentication server: https://minesocial.eviltoaster.workers.dev [authlib-injector] [ERROR] Failed to fetch metadata: java.io.IOException: Server returned HTTP response code: 403 for URL: https://minesocial.eviltoaster.workers.dev

yushijinhun commented 3 years ago

I tested your authentication service and it seems to work fine:

$ java -javaagent:authlib-injector-1.1.38.jar=minesocial.eviltoaster.workers.dev -version
[authlib-injector] [INFO] Logging file: /home/yushi/authlib-injector.log
[authlib-injector] [INFO] Version: 1.1.38
[authlib-injector] [INFO] Authentication server: https://minesocial.eviltoaster.workers.dev
[authlib-injector] [INFO] Disabled Mojang namespace
[authlib-injector] [INFO] Polyfill privileges API
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

If you're still experiencing this problem, try turning off Cloudflare's Browser Integrity Check (in Firewall / Settings).

EvilToasterDBU commented 3 years ago

Try using the injector with the address https://minesocial.ml/ when loading server, I see that there is an authentication request at the address https://minesocial.ml/authenticate not https://authserver.minesocial.net/authenticate, and other request addresses....

upd: authlib-inhector log:

-javaagent:authlib-injector.jar=minesocial.ml -jar mohist.jar
[authlib-injector] [INFO] Logging file: D:\SSD\mohist\authlib-injector.log
[authlib-injector] [INFO] Version: 1.1.38
[authlib-injector] [INFO] Authentication server: https://minesocial.ml
[authlib-injector] [INFO] Disabled Mojang namespace
[authlib-injector] [INFO] Polyfill privileges API

server log:

[18:28:39] [main/INFO] [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService/]: Environment: authHost='https://minesocial.ml/authserver', accountsHost='https://minesocial.ml/api', sessionHost='https://minesocial.ml/sessionserver', servicesHost='http://127.0.0.1:60231/https/api.minecraftservices.com', name='PROD'

my sourсecode

EvilToasterDBU commented 3 years ago

I solved the problem by creating page redirection rules in cloudflare

minesocial.ml/sessionserver/* -> https://sessionserver.minesocial.net/$1
minesocial.ml/api/*-> https://api.minesocial.net/$1
minesocial.ml/authserver/*-> https://authserver.minesocial.net/$1

And all good works.

Снимок экрана (72)

But there was a problem with the display of the cape of another player

image

So far, I am solving this problem from the client side by disabling the cape in the skin customization, but I am curious to know how to solve this problem correctly.

yushijinhun commented 3 years ago

The best way is to let minesocial.ml implement authlib-injector's API, so that there is no need to use elyby-proxy as an API adapter.