0

I know this should be basic but I will despair on this if no one helps me.

I want to get a Signin Token from AWS Federation. This is possible when you call the link:

https://signin.aws.amazon.com/federation?Action=getSigninToken&Session={encodedSession}

Now when I try to fetch it (based on the example codes on the AWS documentation) with this code

await fetch(
            "https://signin.aws.amazon.com/federation?Action=getSigninToken&" +
              qs.stringify({
                Session: JSON.stringify({
                  sessionId: data["accessKey"],
                  sessionKey: data["secretKey"],
                  sessionToken: data["sessionToken"]
                })
              })

it will fail with a CORS error. Even in 'no-cors' mode (I know this is bad) the CORB is blocking everything. How can i fix this?

This all is within a React component!

Edit: Here is the error

CORS ERROR

Derek Brown
  • 4,232
  • 4
  • 27
  • 44
MaddEye
  • 691
  • 4
  • 17
  • 2
    Can you share the error? It doesnt make sense that AWS is rejecting the CORS request – Mike Miller Nov 06 '18 at 08:39
  • 1
    you can't do that from a browser - your server would have no issues with CORS, because it's a server (I assume this because ALL such examples use server side code, not client side code) – Bravo Nov 06 '18 at 08:42
  • https://imgur.com/tTYG023 - here is the screenshot, i will add it to the post – MaddEye Nov 06 '18 at 08:46
  • we all know what a CORS error looks like :p – Bravo Nov 06 '18 at 08:50
  • Possible duplicate of [How does Access-Control-Allow-Origin header work?](https://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work) – sideshowbarker Nov 06 '18 at 09:50

0 Answers0