aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.41k stars 2.11k forks source link

API Gateway Websockets Support #2924

Open alpeshgaglani opened 5 years ago

alpeshgaglani commented 5 years ago

Which Category is your question related to? PubSub What AWS Services are you utilizing? API Gateway, websockets

Provide additional details e.g. code snippets I'm trying to use Amplify to authenticate websockets in AWS API Gateway. I know that Amplify has support to use websockets for AWS IoT and Generic MQTT Over WebSocket Providers, however, there doesnt seem to be support/documentation with https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/.

powerful23 commented 5 years ago

@alpeshgaglani this doc might help you: https://aws-amplify.github.io/docs/js/pubsub#installation-and-configuration

alpeshgaglani commented 5 years ago

@powerful23 : I re-read Pubsub/MQTT docs a few more times, but I still dont know if it helps authenticating API Gateway websockets. For now, I do manual authentication by grabbing the jwt from authenticated user, and writing custom code using node-jose to parse out the kid, verify the token and return the claims. API Gateway websockets do have userpool auth, but I'm lost on the details of how to integrate that with Amplify. Maybe it's just an issue of providing better docs/samples on how to achieve that?

powerful23 commented 5 years ago

@emeryaa can you create a new issue in the repo instead of posting under unrelated ones? Thanks.

0x6C38 commented 5 years ago

So I take it aws amplify doesn't support auth over api gateway websockets yet? Any updates on this?

elorzafe commented 5 years ago

@alpeshgaglani Currently amplify doesnt support API Gateway websockets. I will mark this a feature-request. Thanks for your feedback

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

0x6C38 commented 5 years ago

@alpeshgaglani this issue shouldn't be closed, can you rename it to "API Gateway Websockets Support" or something along those lines to make it more visible?

sammartinez commented 4 years ago

@alpeshgaglani Since this request was cut, documentation has been improved. Is this still a valid use case for you?

mrcportillo commented 3 years ago

any news about this?

ghost commented 3 years ago

Any updates?

wedwards-inirv commented 3 years ago

Any updates?

agileurbanite commented 3 years ago

Is there a use case where IoT with Generic MQTT over websocket providers doesn't meet folks needs compared to API Gateway Websockets support?

Josh-McFarlin commented 3 years ago

Also interested. Has anyone found another way to integrate them?

mrcportillo commented 3 years ago

@Josh-McFarlin I ended up using the standard web socket interface and generating the signature from amplify session in order to authenticate the WS connection.

pauloapi commented 3 years ago

Any update on this feature request? or any alternative way for integration?

mrcportillo commented 3 years ago

@Josh-McFarlin I ended up using the standard web socket interface and generating the signature from amplify session in order to authenticate the WS connection.

@Necromancerx Here https://mrcportillo.medium.com/create-an-aws-sig4-using-amplify-credentials-e5aeb5856c67 there is a way to generate that v4signature using amplify session

s1mrankaur commented 3 years ago

any update on this feature request?

cfbo commented 3 years ago

any update?