Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
Loading New Webpage Using AWS S3 Javascript SDK

I'm new to webdev so forgive me if this is an obvious one, but I can't wrap my head around a solution.

I'm currently hosting a static website on AWS S3. The login page is available for public access, but all other pages are only available to a specific IAM role that an authorized user will assume. Once a user enters their login credentials they will receive temporary AWS credentials that grant them access to restricted pages.

My question is: how do I programmatically load a restricted webpage? Normally I would do something like:

$('body').load(/path/to/index.html);

But the /path/to/index.html is only accessible to users with the IAM role. So do I need to use the S3 sdk to access that file? In my head I would need to do something like:

$('body').load(s3.getObject(/path/to/index.html));

But that wouldn't actually work.

Thanks for the help!

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Do not put the page (HTML) itself as secret. Instead, put your essential data into a json file, and do a XHR to it.

Using a frontend framework with router, you can check if the user is authenticated and render a 403 if not.

The method depends on your framework, and I'm not going to describe it. You can use AWS SDK to fetch from S3 with authentication.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!