Maximvdw / SpigotSite-API

Spigot Site API
24 stars 11 forks source link

User Authentication Issue #14

Open Benz56 opened 3 years ago

Benz56 commented 3 years ago

Authenticating a user via the API results in an NPE.

Using spigotsite-api version 0.3.2-SNAPSHOT and spigotsite version 0.4.1-SNAPSHOT.

Authentication:

spigotUser = spigotSiteCore.getUserManager().authenticate(
        username,
        password,
        twofa
);

Causing

java.lang.NullPointerException
    at be.maximvdw.spigotsite.user.SpigotUserManager.authenticate(SpigotUserManager.java:101)
    at be.maximvdw.spigotsite.user.SpigotUserManager.authenticate(SpigotUserManager.java:78)

Caused by the response values being null. Exceptions occurs here:

if (res.getResponseURL().toString().startsWith("https://www.spigotmc.org/login/two-step")) {

Where the response is:

Debug

Similar to issue #13 with some extra details.

Benz56 commented 3 years ago

Some more details: The post method in the JsoupRequest class file throws an exception. The HTTP response code of the request is 503. This is most likely caused by Cloudflare blocking non-human requests.

Osiris-Team commented 3 years ago

@Benz56 yep. More details here: https://github.com/Osiris-Team/AutoPlug-Client/issues/6