Louuke / McReverse

Reverse engineered library for the german McDonald's API in Java
Apache License 2.0
29 stars 0 forks source link

Read timed out for registration request #19

Closed gwiam closed 1 year ago

gwiam commented 1 year ago

Hey, wanted to say thanks for your projects, super interesting (and useful), just discovered this! I'm myself a a user of your site so I was curious if there was a repo for the McD stuff in the background.

I was playing around with the code myself and registering a new account seemed to have lead to a timed out error. Is the code in the main branch broken, the server unavailable/changed or did I just do it wrong?

McClient testClient = new McClient();
RegisterResponse resp = testClient.register(...)
if (resp.success()){
            System.out.println("Registration successful!");
            System.out.println("Device id: " + resp.getDeviceId());
            System.out.println("Status message: " + resp.getStatus().getMessage());
            System.out.println("Status code: " + resp.getStatus().getCode());
            System.out.println("Status type: " + resp.getStatus().getType());
            System.out.println("Status errors: " + resp.getStatus().getErrors().toString());
}
Louuke commented 1 year ago

Hey, I'm glad you like my project. Since I mainly use it for my own services, it is not commented and therefore I can also understand that it is difficult to understand the error.

First of all: Yes, the main branch is stable, although I often just use the dev branch.

The timeout error occurs because McD wants an Akamai Sensor Token for some requests, such as login or registration. If this is not sent with the request header, the request times out. Therefore, the setTokenSupplier method of the client class must be called and a token supplier must be passed before a corresponding request is made.

The generation of this token is done by the McD app. This means that in order to be able to use this project, you need a way to obtain sensor tokens.