How do I generate a json web token from construct2

Get help using Construct 2

Post » Wed Jan 17, 2018 9:50 am

Hello there!

I want to ask if someone has experience with construct2/3 / JSON Web Token / webserver highscore list. And how i could setup the communication between construct2 and the target website with JSON Web Token.

In my game there will be a score generated, which i would have to encode (JSON Web Token), send it to the website, wehre the highsocre table is embedded. The php script should decode the JSON Web Token and set the score into the list.

* JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties.

Any ideas or references or tutorial would be great.

Thank you very much!
B
13
S
2
Posts: 193
Reputation: 1,235

Post » Tue Jan 30, 2018 3:34 pm

Someone?
B
13
S
2
Posts: 193
Reputation: 1,235

Post » Wed Jan 31, 2018 1:59 am

Is this your own webserver or some third-party service like clay.io?
Do you have any documentation on JSON format required by this service, authentication etc.?
B
17
S
9
G
126
Posts: 1,745
Reputation: 67,311

Post » Wed Jan 31, 2018 8:20 am

@dop2000

Thanks for your answer!

Its a third-party server, basically from our customer. Basically i have a reference, but iam not so deep in this topic - so i cant say who has to deliver what to get this to run.

For excample: Do i need to integrate a java library, or do i have to implement something else...in the project, and can construct3 handle this, etc. Thats the main questions i wanted to start asking. Probably you did this in your project and you could tell me the "steps" i would have to pay attention on.

That would be awesome to understand this materia.

Thank you very much!
B
13
S
2
Posts: 193
Reputation: 1,235

Post » Wed Jan 31, 2018 8:32 am

It's impossible to say without the documentation.
You might need to install an addon (like this one) to parse JSON strings.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
126
Posts: 1,745
Reputation: 67,311

Post » Wed Jan 31, 2018 9:57 am

@dop2000

Thank you for the information - the plugin isn´t available for construct3 i guess. Do you know alternatives?

Documentation Link:
https://jwt.io/

But the basic question i have is how to use this (i think there are several pages like i included above) method with construct3.

It should be possible with get and post functions but to use this encoding it shouldn´t be a post command to an extern library, because this could be manipulated too (to avoid this is the basic function of this token), so i guess i would have to have a kind of library in my root folder and use a "encode my variable and send it to url" function...

but iam absolutly not sure with my intention. Maybe i get something wrong in understanding this thing...

Thats why iam asking for helping people like you :)


Note: I saw, that the question is how to do this in construct2 but i made the project with construct3
B
13
S
2
Posts: 193
Reputation: 1,235

Post » Wed Jan 31, 2018 10:13 am

So the communication is encrypted.. Then you are probably right, you will need a plugin or JS function that will handle encryption.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
126
Posts: 1,745
Reputation: 67,311

Post » Mon Feb 05, 2018 9:52 am

@dop2000

okay - have to take a look how to do this - did you got some experience with that?
B
13
S
2
Posts: 193
Reputation: 1,235

Post » Mon Feb 05, 2018 10:05 am

Nope, sorry. I really though this was something simple like sending JSON in clear text.

There are several JS libraries available on jwt.io website, so I guess you need to find somebody who can make a plugin from that.
Try posting a request in this forum:
extending-construct-2_f183
B
17
S
9
G
126
Posts: 1,745
Reputation: 67,311


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests