tuya / tuya-android-industry-app-sdk-sample

This sample provides examples of Tuya Industry App SDK basic functions such as device network configuration, login and registration, and asset management of Tuya Open API.
MIT License
0 stars 0 forks source link

sign invalid #11

Closed Mikiiw closed 2 years ago

Mikiiw commented 2 years ago

I'm trying to develop a way to connect to my smart plug via android SDK but I'm struggling to get past the signing process. Any invalid access id gives me an ip block but the android sdk client id and secret gives me this:

RequestTask onResponse body: {"code":1004,"msg":"sign invalid","success":false,"t":1657718894856,"tid":"a625198b02af11ed88959287a6a8350d"}
 (31109): RequestTask errorCode: 1004 errorMessage: sign invalid

I've not been able to continue part this part. Is there any advice so I can move forward with this process?

radishwu commented 2 years ago

Have you tried this way, like this https://developer.tuya.com/en/docs/app-development/preparation?id=Ka69nt983bhh5#title-1-Procedure.

Mikiiw commented 2 years ago

Your readme uses everything from the cloud development platform and not via the app platform. Unfortunately I did not follow this doc to get the SDK working

edit: I've also been using the sample sdk given here which gives me an invalid sign. I've found the iOS version for the SDK is working though so I'm confused why theres validation errors with what I've been doing

Mikiiw commented 2 years ago

chrome_uNMTscg9Kw

I've used the endpoint from the api explorer to see if I'm able to login using the cloud auth. I can successfully generate a token this way

chrome_HedXwwSsR7

This is the expected output I should get from the API. However I'm not, I'm receiving an 'invalid signing response'. I would appreciate any response to what I've found

radishwu commented 2 years ago

Did you add SHA256 hash value? Android SDK need this. see https://developer.tuya.com/en/docs/app-development/iot_app_sdk_core_sha1?id=Kao7c7b139vrh. and image

radishwu commented 2 years ago

If still wrong, we suggest you move here to ask your question: https://service.console.tuya.com/8/3/create?step=4&id=01030408&source=suspension,to provide you with one-on-one guidance to match.

Mikiiw commented 2 years ago

chrome_TmFqlq4QGj

This is the wrong information. I've been asking for any advice on using this Industry App SDK. The information you've given me is for the Smart Life App configuration.

I have already opened a ticket to discuss this issue with technical support. But wondering if anyone here has had success with the signing generation

radishwu commented 2 years ago

Please check this doc .

Mikiiw commented 2 years ago

Signing issue has been resolved. Basically didn't implement the signing config correctly image

I was trying to use my own app to develop, but the docs completely skipped the steps involving SHA1 signing. I'll see if I can ask them to update the document when you're not using this sample SDK