Skip to content

Extend the time of a signed url  #156

Description

@AElbert

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions