Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the time of a signed url #156

Open
AElbert opened this issue Sep 3, 2023 · 0 comments
Open

Extend the time of a signed url #156

AElbert opened this issue Sep 3, 2023 · 0 comments

Comments

@AElbert
Copy link

AElbert commented Sep 3, 2023

I am signing a url for iot core as follows:

const aws = new aws4.RequestSigner(
    {
      host: AWS_IOT_ENDPOINT,
      path: "/mqtt",
      service: "iotdevicegateway",
      region: "",
      signQuery: true,
    },
    {
      accessKeyId: "",
      secretAccessKey: "",
    }
  );

let { path } = aws.sign();

const url = wss://${AWS_IOT_ENDPOINT}${path}

But I need to lengthen the time in which the url expires to be able to connect again to the socket, I have tried some things like:

const awsDate = new Date();
awsDate.setMinutes(awsDate.getMinutes() + 20);
const isoDate = awsDate.toISOString().replace(/[:\-]|\.\d{3}/g, "");

aws.datetime = isoDate;

Change path parameter:

path: "/mqtt?X-Amz-Expires=3600",

And it hasn't worked, any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant