games647 / FastLogin

Checks if a minecraft player has a valid paid account. If so, they can skip offline authentication automatically. (premium auto login)
https://www.spigotmc.org/resources/fastlogin.14153
MIT License
494 stars 121 forks source link

FastLogin isn't working with Authlib-Injector #1236

Closed IkyMax closed 1 month ago

IkyMax commented 1 month ago

What happened?

I can't use FastLogin with Authlib-Injector in Arclight 1.16.5, disabling Authlib injector will work but i want to use my own Yggdrasil server, i used both legacy version (It throws me the error in Server Log) and Latest version (It throws me an error with "Encrypting player info")

Steps to reproduce

  1. Setup an ArcLight 1.16.5 server with Authlib-Injector
  2. Configure FastLogin
  3. Try to join with an authlib account
  4. See console

(My auth endpoint: https:/auth.lsmp.site/api/yggdrasil/ Account: Test Password: Test1234)

Plugin list

AuthMe(Legacy) and ProtocolLib 4.8.0

Configuration file

https://hastebin.com/share/amogevilen.yaml

Server log

[02:22:02] [Server thread/INFO] [FastLogin/]: Enabling FastLogin v1.11-a9e4c90

....[authlib-injector] [INFO] Transformed [com.github.games647.craftapi.resolver.MojangResolver] with [Constant URL Transformer] [authlib-injector] [INFO] Transformed [com.github.games647.fastlogin.core.mojang.ProxyAgnosticMojangResolver] with [Constant URL Transformer] [02:22:03] [Server thread/INFO] [f.h.HikariDataSource/]: FastLogin - Starting... [02:22:03] [Server thread/INFO] [f.h.HikariDataSource/]: FastLogin - Start completed. [02:22:03] [Server thread/INFO] [Minecraft/]: Server permissions file permissions.yml is empty, ignoring it [02:22:03] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for dimension minecraft:overworld [02:22:05] [Server thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [02:22:05] [Server thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [02:22:05] [Server thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [02:22:05] [Server thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [02:22:05] [Server thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [02:22:09] [Worker-Main-7/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [02:22:09] [Worker-Main-6/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [02:22:09] [Worker-Main-6/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [02:22:09] [Worker-Main-8/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [02:22:09] [Worker-Main-8/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [02:22:09] [Worker-Main-8/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [02:22:09] [Worker-Main-6/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 99% [02:22:09] [Worker-Main-8/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 99% [02:22:10] [Server thread/INFO] [minecraft/LoggingChunkStatusListener]: Time elapsed: 6436 ms

container@panel~ Server marked as running... [02:22:10] [Craft Scheduler Thread - 1/INFO] [AuthMe/]: Downloading GEO IP database, because the old database is older than 30 days or doesn't exist [02:22:10] [Craft Scheduler Thread - 1/WARN] [AuthMe/]: No MaxMind credentials found in the configuration file! GeoIp protections will be disabled. [02:22:10] [Craft Scheduler Thread - 1/INFO] [AuthMe/]: There is no newer GEO IP database uploaded to MaxMind. Using the old one for now.

[02:22:10] [Server thread/INFO] [FastLogin/]: Hooking into auth plugin: AuthMeHook ....[authlib-injector] [INFO] Transformed [com.mojang.authlib.properties.Property] with [Yggdrasil Public Key Transformer] [02:22:36] [Craft Scheduler Thread - 1/INFO] [FastLogin/]: Handling player Staff [02:22:36] [Craft Scheduler Thread - 1/ERROR] [FastLogin/]: Failed to check premium state for Staff java.lang.ClassCastException: sun.net.www.protocol.http.HttpURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection at com.github.games647.craftapi.resolver.AbstractResolver.getConnection(AbstractResolver.java:132) ~[?:?] {re:classloading,re:classloading} at com.github.games647.craftapi.resolver.AbstractResolver.getConnection(AbstractResolver.java:120) ~[?:?] {re:classloading,re:classloading} at com.github.games647.craftapi.resolver.MojangResolver.findProfile(MojangResolver.java:172) ~[?:?] {re:classloading,re:classloading} at com.github.games647.fastlogin.core.shared.JoinManagement.onLogin(JoinManagement.java:93) ~[?:?] {re:classloading,re:classloading} at com.github.games647.fastlogin.bukkit.listener.protocollib.NameCheckTask.run(NameCheckTask.java:70) ~[?:?] {re:classloading,re:classloading} at com.github.games647.fastlogin.core.AsyncScheduler.lambda$runAsync$0(AsyncScheduler.java:70) ~[?:?] {re:classloading,re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) [?:1.8.0_312] {} at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:81) [arclight:arclight-1.16.5-1.0.25-7cf92be3] {re:classloading} at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [arclight:arclight-1.16.5-1.0.25-7cf92be3] {re:classloading} at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_312] {} at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_312] {} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312] {}

Plugin version

FastLogin v1.11 Legacy

Platform

Spigot

Relevance

games647 commented 1 month ago

Well it looks like they don't provide a https connection class than a HTTP class. Currently, FastLogin requires those, because it allows to customize the outgoing IP address.

IkyMax commented 1 month ago

Well it looks like they don't provide a https connection class than a HTTP class. Currently, FastLogin requires those, because it allows to customize the outgoing IP address.

I'm using https in the Authserver, i've already tried with two Yggdrasil server providers, both in https, so, it's really weird

games647 commented 1 month ago

Yes, but this injector only provides the HTTP code class variant.

IkyMax commented 1 month ago

Ok i'm dumb, it works now, for anyone who's trying to set up FastLogin with Authlib-Injector, you'll need to use the -Dauthlibinjector.disableHttpd flag (and your authserver must be in HTTPS lol, Drasl is a good option)