-
Notifications
You must be signed in to change notification settings - Fork 213
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
Using AWS IoT Core policy variables won't work (Cognito) #139
Comments
Could you explain step 4 more. I attempted to reproduce the same error you're getting, but I was unable to. It might be on my end, because I changed an already working pub_sub and might have forgotten to change something. |
@jmklix, I forgot to specify that I'm using Cognito User Pools to communicate with AWS IoT Core. So on the step 4 I'm adding AWS IoT-specific permission (
|
I'm still a little confused about how you set this up. Did you follow this guide or are you generating a session token like shown here? |
Yeah, in my case I use approach that is similar to the first link you've provided, here is some code snippets using
Now let's connect to AWS IoT.
and the result is :
However it will work if I specify policy in the following manner (with explicit
Even more if I will create a policy with Cognito Identity Id policy variable
|
Sorry for the slow response, but I haven't been able to get it working. I have also noticed that we don't currently support the v2 sdk's with Cognito yet. I will change this to a feature request so we can make sure to update you when we implement it. |
Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one. |
Any update on this issue? We're facing the same. |
https://docs.aws.amazon.com/iot/latest/developerguide/thing-policy-variables.html When you're replacing thing names with thing policy variables, the value of clientId in the MQTT connect message or the TLS connection must exactly match the thing name |
The SDKs do not have any control over policy variables, checking, or substitution. This would be a question better suited for the AWS forums or a support contact. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Platform/OS/Device
macOS Catalina, python3.8
Describe the question
I faced with a weird behaviour using SDK and policy variables. The problem is that when I use AWS IoT Core policy variables then I'm not able to even connect to IoT Service.
Steps:
dummy
(without any certificates).Then I'm trying to connect:
with the following result:
However, when I change the policy document to a "hardcoded" thing name value (
dummy
) it works:The text was updated successfully, but these errors were encountered: