Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientToken is limited to 64 bytes #28

Closed
rkawajiri opened this issue Dec 7, 2016 · 6 comments
Closed

ClientToken is limited to 64 bytes #28

rkawajiri opened this issue Dec 7, 2016 · 6 comments

Comments

@rkawajiri
Copy link

I cannot find documentations about the limits of client token (e.g. http://docs.aws.amazon.com/iot/latest/developerguide/iot-limits.html, http://docs.aws.amazon.com/iot/latest/developerguide/thing-shadow-document.html#client-token ). However, based on my try-and-error with AWS IoT Console, the length of client token seems to be limited to 64 bytes.

Below code generating client token does not check the length of client token. So, shadow request sometimes causes errors, when client id and/or shadow name are too long.

https://github.com/aws/aws-iot-device-sdk-python/blob/master/AWSIoTPythonSDK/core/shadow/deviceShadow.py#L32-L35

@rkawajiri
Copy link
Author

rkawajiri commented Dec 7, 2016

Below code is my sample of solution. When creating a device shadow object, a prefix can be set manually. This code works on my project.
https://github.com/aws/aws-iot-device-sdk-python/compare/master...strobo-inc:feature/client_token_limits?diff=unified&expand=1&name=feature%2Fclient_token_limits&w=1

@fengsongAWS
Copy link

Thanks @rkawajiri for your interest in AWS IoT SDK. Yes, you are correct. There is no check for the length of client token. Thanks for your effort of pulling request. However, we do not normally directly take PR through github. AWS IoT has its own internal process of releasing but we do give people credit if we take their code into the release.

Thanks again,
Fengyi

@rkawajiri
Copy link
Author

rkawajiri commented Dec 7, 2016

@fengsongAWS
Thank you for your reply. I've understood the releasing process.

I have one question. Is there a documentation about the limitation of the client token?

@fengsongAWS
Copy link

Unfortunately, there's no documentation about the client token for now which is supposed to be I think. Some SDK e.g. Node.js already dealt with this case while some haven't. You can find more about AWS IoT limit here. AWS IoT Limit

@ftuan
Copy link

ftuan commented May 9, 2017

@fengsongAWS

Any update on this issue? I'm getting "ERRORCODE:400 MESSAGE:invalid client token" from AWSIoTLogs in CloudWatch. I think the error is caused by SDK generating client token longer than 64 bytes. Is there a way to confirm? I have the client token from debug logs.

@liuszeng
Copy link
Contributor

Addressed in v1.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants