How to generate an authentication token to connect to Websocket API using HTTP @connections endpoints.

0

Hello community, I have set up an API gateway using lambda to connect EC2 and BUBBLe through API coonector I have tested using wscat , its worked fine , but I have added the URL for the production API i got this response raw response for the api status code 403 {"message", "missing authentification token"}. Where can i found the token ?, i tried cloudwatch with no success

best

1 Answer
0

1. What is 403 {"message": "missing authentification token"} error?

  • This is a generic error returned from API Gateway REST API endpoints due to various reasons such as API request made to non-existent resource or method, unsigned API request made to method secured by AWS_IAM and so on. Please refer to this article for details.

2. How do we call @connections endpoints for API Gateway Websocket API using HTTP requests?

  • As noted in this documentation here, @connections URL for WebSocket APIs is used to send a callback message to a connected client, get connection information, or disconnect the client. All calls here need a connectionId in Url path for client context and they must use IAM authorization with SigV4.

3. What could be going on here in our use case?

  • We would need more clarity into the setup here for a precise answer but do confirm if you are using the @connections endpoint with client context(i.e. valid connectionId in Url path) and AWS_IAM SigV4 signature.
  • You could also enable CloudWatch logs & access logs for your stage as noted here for more context but do note that this may lead to additional CloudWatch charges.

For further help, we may need details that are non-public information. Please open a support case with AWS using the following link.

AWS
SUPPORT ENGINEER
answered 10 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions