1

Token based login is not consistent

Topic: Token based login is not consistent

Hi,

When I try to call the login API(token/login) method, I'm keep getting error code '4'. I have also tried to generate new token,
keep getting same error with new token. Token based login is not consistent now a days. Can you please help me to solve this issue asap.

http://hosting.wialon.com/login.html?cl … duration=0

Note: It was working after some time.

Thanks in advance

Thanks
J Prabhu
2

Token based login is not consistent

Re: Token based login is not consistent

prabhu.janakiraman, provide please more details about broken tokens. You can send private message with Your user login and example of broken tokens. Also You can test token creation and login on our playground site https://sdk.wialon.com/playground.

Head of Wialon Local Department
Gurtam
3

Token based login is not consistent

Re: Token based login is not consistent

Deal,

I am also experiencing the same, some times it is working next time it is not working. I also did one more test by hosting the App in different web server so that the IP will be different but initially it worked but after some time it si not consistent as well.

We are using core/use_auth_hash API which is totally inconsistent, most of the time we get error code 4

Action : UseAuthHash
Method Parameters : {"request":{"AuthHash":"04a97c11aa3b75cc5bfd8471bf147be9","OperateAs":"sampleuser"}}
Error Code : 4

Error Description : Invalid input [core/use_auth_hash]

Please let me know how to handle this.

Thanks in advance
Karthik

4

Token based login is not consistent

Re: Token based login is not consistent

karthik, prabhu.janakiraman, error code 4 is returned if wrong parameters were passed: invalid json, token of incorrect length (more or less than 72 chars), wrong parameter name ("token", "authHash"), keys and values without double quotes. Server even doesn't try to login in this case.

Head of Wialon Local Department
Gurtam
5

Token based login is not consistent

Re: Token based login is not consistent

Deal,

We figured out it isnot the issue of the API and it is the way we consumed the API, we didn't enclosed the keys with double quotation that's why it broke and after fixing it with double quotes it is working fine now

Issue Root Cause :
    var param = string.Concat("{authHash: \"", request.AuthHash, "\", operateAs:\"", request.OperateAs, "\", checkService:\"\"}");

Issue Fix :
    var param = string.Concat("{\"authHash\": \"", request.AuthHash, "\", \"operateAs\":\"", request.OperateAs, "\", \"checkService\":\"\"}");


Thanks
Karthik

6

Token based login is not consistent

Re: Token based login is not consistent

Hi Deal,

I was also facing the same issue and resolved it by adding double quotes for both keys and values.

Thanks,
Pramod

7

Token based login is not consistent

Re: Token based login is not consistent

he he he, learning by doing :-)

thanks for sharing your results here that other can find their errors faster!

Politeness dictates it to write his name on a post