question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IncompleteSignatureException error response from GraphQL request

See original GitHub issue

Do you want to request a feature or report a bug? Bug

What is the current behavior? In our other app utilizing amazon-cognito-identity-js I could send a request with the header Authorization: Bearer token and authenticate via our APIG’s custom authorizer. Using Amplify I get the error IncompleteSignatureException returned when making my request.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn’t have dependencies other than AWS Amplify.

Using withAuthenticator HOC to log in. The API portion of my aws-exports looks like so:

 API: {
    graphql_headers: async () => ({
      Authorization: await Auth.currentAuthenticatedUser().then(user => {
        console.log(user.signInUserSession.idToken.jwtToken);
        return `Bearer ${user.signInUserSession.idToken.jwtToken}`;
      })
    }),
    graphql_endpoint: '/api' // using reverse proxy to reach my API without triggering CORS errors
  }

We have existing infrastructure, so I am deploying via serverless, not aws-mobilehub. This app uses React and we are trying out aws-amplify-react’s Connect component to make the request. I am able to see the POST request in my Network tab, and the request has the Authorization header I am expecting to see, but the response headers contains x-amzn-errortype: IncompleteSignatureException.

With window.LOG_LEVEL = DEBUG enabled I am also seeing this error cropping up in the output:

"[DEBUG] 00:01.968 AWSPinpointProvider - updateEndpoint failed": MissingRequiredParameter
code: "MissingRequiredParameter"
columnNumber: 43
fileName: "http://localhost:3000/static/js/bundle.js"
lineNumber: 49547
message: "Missing required key 'ApplicationId' in params"
name: "MissingRequiredParameter"
stack: ["..."]

We have a identity pool configuration whose id is referenced in the aws-export Auth block. I’m guessing the missing applicationId and signing issue has to do with a mis-configuration of the Amplify tool, but I have been unable to find what that might be from the docs or other reported issues

What is the expected behavior? I should receive my GraphQL response

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions? Currently using

"aws-amplify": "0.4.4"
"aws-amplify-react": "0.1.50"

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
dehuszarcommented, Jun 11, 2018

I figured out the issue. APIG just returns misleading error messages.

I have the create-react-app proxy configuration in place. The what the proxy sends out is not console’d anywhere, so I did not see that the proxy configuration was appending a path segment to the target endpoint. This was creating the 403. The fact that AWS doesn’t just say that endpoint doesn’t exist is what threw me off. smh

Is returning a 403 vs a 404 some kind of security through obscurity strategy? It makes things incredibly hard to debug.

I had to use httpbin (httpbin.org) to catch the request contents and see what was happening

0reactions
github-actions[bot]commented, Jun 13, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is AWSAppSyncClient IAM throwing ... - Stack Overflow
i'm trying to implement an unauthenticated graphql request using IAM ... Based on the error response it says that i'm not sending accept...
Read more >
Error handling - Apollo GraphQL Docs
A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ. OPERATION_RESOLUTION_FAILURE. The...
Read more >
Resolve unauth errors for GraphQL requests in AWS AppSync
There are two types of unauthorized errors that are defined by the HTTP status code that's returned in the response:.
Read more >
Top GraphQL Errors and How to fix them
Error handling in GraphQL is different on both server & client-side ... at HTTP status codes to debug what went wrong for the...
Read more >
GraphQL error handling to the max with Typescript, codegen ...
400 : bad request (e.g. invalid inputs); 401 or 403 : unauthorized (need authentication) or forbidden (insufficient permission); 404 : resource ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found