```
// Put your logs below this line
[DEBUG] 34:13.758 AWSAppSyncRealTimeProvider Auth - Authenticating with "iam"
[DEBUG] 34:13.759 CognitoCredentialsProvider - Clearing out in-memory credentials
[DEBUG] 34:13.880 AWSAppSyncEventsProvider - Establishing retryable connection
[DEBUG] 34:13.880 retryUtil - bound attempt #1 with this vars: ["wss://gasctn76kraldllcpmqms44pyu.appsync-realtime-api.eu-west-1.amazonaws.com/event/realtime","header-eyJhY2NlcH ......
[DEBUG] 34:13.880 AWSAppSyncEventsProvider - Establishing WebSocket connection to wss://gasctn76kraldllcpmqms44pyu.appsync-realtime-api.eu-west-1.amazonaws.com/event/realtime
[DEBUG] 34:14.119 AWSAppSyncEventsProvider - subscription message from AWS AppSyncRealTime: {"errors":[{"errorType":"BadRequestException","message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.\n\nThe Canonical String for this request should have been\n'POST\n/event\n\naccept:application/json, text/javascript\ncontent-encoding:amz-1.0\ncontent-type:application/json; charset=UTF-8\nhost:api-id.appsync-api.eu-west-1.amazonaws.com\nx-amz-date:20241111T173413Z\nx-amz-security-token:xxxxxxxxxxxxx\n\naccept;content-encoding;content-type;host;x-amz-date;x-amz-security-token\nxxxxxxxxxxxxxx'\n\nThe String-to-Sign should have been\n'AWS4-HMAC-SHA256\n20241111T173413Z\n20241111/eu-west-1/appsync/aws4_request\n714896dcf56b33c34cec13ee8137ebc0a5c35895af0ac92924fd111a4ccab2e4'\n","errorCode":400}],"type":"connection_error"}
[DEBUG] 34:14.120 retryUtil - error on bound NonRetryableError: BadRequestException
at AWSWebSocketProvider._establishConnection (aws-amplify_data.js?v=b49bb864:7873:17)
at async chunk-2MQQKA2O.js?v=21653013:1073:17
DEBUG] 34:14.120 retryUtil - bound non retryable error NonRetryableError: BadRequestException
at AWSWebSocketProvider._establishConnection (aws-amplify_data.js?v=b49bb864:7873:17)
at async chunk-2MQQKA2O.js?v=21653013:1073:17
chunk-2MQQKA2O.js?v=21653013:114 [DEBUG] 34:14.120 AWSAppSyncEventsProvider - Connection exited with NonRetryableError: BadRequestException
at AWSWebSocketProvider._establishConnection (aws-amplify_data.js?v=b49bb864:7873:17)
at async chunk-2MQQKA2O.js?v=21653013:1073:17
chunk-2MQQKA2O.js?v=21653013:107 [DEBUG] 34:14.121 AWSAppSyncEventsProvider {err: NonRetryableError: BadRequestException
at AWSWebSocketProvider._establishConnection (http://loc…}
```
The header, once base64 decoded has the following JSON (redacted):
```json
{
"accept": "application/json, text/javascript",
"content-encoding": "amz-1.0",
"content-type": "application/json; charset=UTF-8",
"host": "api-id.appsync-api.eu-west-1.amazonaws.com",
"x-amz-date": "20241111T173413Z",
"x-amz-security-token": "xxxxxxxx",
"authorization": "AWS4-HMAC-SHA256 Credential=ASIAXxxxxxxxxxxxxxx/20241111/eu-west-1/appsync/aws4_request, SignedHeaders=accept;content-encoding;content-type;host;x-amz-date;x-amz-security-token, Signature=5ecfxxxxxxxxxxxxxxxx"
}
```
Before opening, please confirm:
JavaScript Framework
Not applicable
Amplify APIs
GraphQL API
Amplify Version
v6
Amplify Categories
api
Backend
None
Environment information
Describe the bug
When using the
aws-amplify/data
with an Events API set up with IAM authentication, the connection fails with aNonRetryableError
.Expected behavior
The Websocket should work with IAM authentication.
Reproduction steps
Code Snippet
Log output
See logs below ⬇️ ⬇️ ⬇️ ⬇️ ⬇️
aws-exports.js
No response
Manual configuration
Additional configuration
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response