How to start Moralis with version 2?

OK , thank bro
I will try with appid production

That is appId I set in parse-server
image

Aaa, that is Moralis Key not app parser server

it should be the app id there, not the api key, when you call a cloud function

the url should be different, not http://localhost:1337/server, the url should point to the cloud function that you want to call

I ran parse-server local, my link http://localhost:1337/server.

I will test on production

I mean the end of the url should contain the cloud function name, the start of the url is not the issue

1 Like

Im done with cloud functions but got error with verify function.

I post to url/users for authentication and got error:
image
image

Why I got error?
I signature from client and send to server for verify got error

I don’t know, it looks like you are close. Try to log th parameters sent to verify function

1 Like

Yes, very close.

This picture above is log params send to verify :).

Those are not the parameters, the parameters are the message and the signature

That is signature and data send to verify
I send to ```
https://YOUR.PARSE-SERVER.HERE/parse/users

with authData 

const authData = {
id: addressLogin,
signature: signature,
data: message,
};

For Moralis.auth.verify function try to log the parameters

Yes, bro. That is authData I logged

image

Try to log the parameters separately just to make sure that they have the value that you expect. You logged there an entire object and not each parameter one by one.

I tried to log signature and data:
image

that timestamp for Issued At seems to be from the past, from few hours ago, you are trying with the same message multiple times?

Yes, I saw timeout 15 min for signature but I sign asap still not working :(.

I got this error:

"code": "ERR_JWS_INVALID",
        "name": "JWSInvalid"

What is JWS ?

I sign message by code from Unity, what wrong in signer function ? Cause for error Invalid data in verify function Moralis ?

image

you can change that 15 seconds timeout to 55 seconds in code

you have to make care at the signed message, it has to be identical with the one that you received initially , if you sign the message with a private key in backend then you have make sure that you use the equivalent of signing a message and not the equivalent of signing a transaction

you can use this example in python to test:

1 Like