1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
0
I actually found the solution to this after MANY hours of tracing and documentation. In all of the examples given to use Cognito authenticated identities with IoT Core pub/sub, there is one key API call left out:
id_client = boto3.client('cognito-identity')
id_response = id_client.get_id(
AccountId=os.getenv('AWS_ACCOUNT_ID'), -- AWS Account ID - I don't like this.
IdentityPoolId=os.getenv('COGNITO_IDENTITY_POOL_ID'),
Logins={
os.getenv('COGNITO_USER_POOL_URL'): idtoken --from initiate_auth authentication result
}
)
identityId = id_response['IdentityId'] -- You need this for the call to new_cognito(...)
This call comes after initiate_auth(...) and before auth.AwsCredentialsProvider.new_cognito(...) identity kwarg
beantwortet vor 4 Monaten
Relevanter Inhalt
- Wie veröffentliche ich MQTT-Nachrichten von meinem Gerät auf AWS IoT Core, wenn ich Python verwende?AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor einem Jahr