AWS Signer support for Flutter

479

I have almost exactly the same use case you have. I have written and released a simple library that can do what you want, creating a presigned URL to connect to AWS WebSocket API Gateway secured by IAM:

https://github.com/MohammedNoureldin/aws_url_signer

Basically you will get your signed URL just like this:

String getSignedWebSocketUrl(
    {String apiId,
    String region,
    String stage,
    String accessKey,
    String secretKey,
    String sessionToken})
Share:
479
Nilesh
Author by

Nilesh

Updated on December 01, 2022

Comments

  • Nilesh
    Nilesh over 1 year

    We are building a mobile app using Flutter that connects to WebSocket (AWS). The user will SignUp / SignIn to the app using AWS Amplify Auth. After authentication is successful the app will establish a connection to WebSocket on AWS. In order to make our connection to WebSocket secure, we want to use AWS Signer v4 to sign the URL. But we couldn't find any support on AWS Signer v4 for Flutter. Kindly provide us help so that we can use Signer v4 using Flutter something like plugin etc.

    Thank You

    • Mohammed Noureldin
      Mohammed Noureldin about 3 years
      Do you have any news? I have the exact same use case and cannot figure out what to do.
  • Hari Honor
    Hari Honor almost 3 years
    This lib for some reasons signs a few headers in addition to just "host" which is what aws wants for websockets. It's also no longer maintained :/
  • Hari Honor
    Hari Honor almost 3 years
    I made some amends to make it work for the AWS Transcribe API. Not sure if that service has a slightly different format or the code in Mohammed's has fallen out of date.... Check the diff for comparison. github.com/Air-Craft/aws_url_signer