GithubHelp home page GithubHelp logo

Comments (5)

kjpluck avatar kjpluck commented on July 22, 2024 1

All sorted. Just spent a brain melting day setting up a CF distribution that requires signed urls. Thanks for your help!

from cloudfront-authorization-at-edge.

kjpluck avatar kjpluck commented on July 22, 2024

Have also tried this on a dev server and getting same so localhost not a factor

from cloudfront-authorization-at-edge.

ottokruse avatar ottokruse commented on July 22, 2024

Can you share an architecture diagram? And it would help to see the HAR file. If it is too sensitive to share here you can mail it to me at ottokrus at amazon nl

The user visits our app and gets redirected to Cognito to login and are redirected back on success. The app loads and starts making requests to CF like so:

https://zzzzzz.cloudfront.net/data/blahblah/foobar.json

CF redirects (307) the request to Cognito:
...

That's not right. After you signed in successfully you should have cookies with valid JWTs and then should no longer get 307s.

from cloudfront-authorization-at-edge.

kjpluck avatar kjpluck commented on July 22, 2024

As the site is on a different domain to CF and Cognito this isn't possible which may well explain the CORS errors.

If there isn't a way around this then I will be exploring signed urls.

from cloudfront-authorization-at-edge.

ottokruse avatar ottokruse commented on July 22, 2024

As the site is on a different domain to CF and Cognito this isn't possible which may well explain the CORS errors.

If there isn't a way around this then I will be exploring signed urls.

Aha two different domain names. Yes signed URLs is the way. Use an Cognito Identitity Pool to trade your JWTs for temporary AWS credentials with which you can create a signed URL. Amplify Storage makes this easy, does it automatically if you configure Amplify with an Identity Pool.

from cloudfront-authorization-at-edge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.