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

Error 400 Bad Request on GET Icon #152

Open
satryacode opened this issue Aug 4, 2020 · 1 comment
Open

Error 400 Bad Request on GET Icon #152

satryacode opened this issue Aug 4, 2020 · 1 comment

Comments

@satryacode
Copy link

satryacode commented Aug 4, 2020

When using S3 Bucket,
I got 400 Bad Request error when loading app's icon,
and if you try to inspect the network tab,
it will show

<Error>
  <Code>InvalidArgument</Code>
  <Message>Unsupported Authorization Type</Message>
  <ArgumentName>Authorization</ArgumentName>
  <ArgumentValue>Bearer eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE1OTY1MjAwODguODY2NzIsInVzZXJfaWQiOiI3QTc0RjQ0Ni0yQTI0LTRGMzAtQTEzMi1EMEUxMjUzQTVCMEQifQ.j3iMlWaqUm2x5oJ4sQjUgqrJPZx7g3LX-SGtSPWKCdiIdMqXb0ikPVRZzDUHdB3qYl3QhX-IZKxkGrALvJHUYg
  </ArgumentValue>
  <RequestId>XXXXCH1TCT1M9SXX</RequestId>
  <HostId>XXXXn85762i7OeQPfu0/zj1cbDtdylgnXE7l4Sz6KKaQq2kvJWbF4DeVLSQcaeexvT6I4fTqKGE=</HostId>
</Error>

Before that, I got CORS error,
after applying cors configuration on my s3 bucket,
the cors error resolved, but then I got 400 Bad Request.

Here is my cors config

<CORSConfiguration>
  <CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>HEAD</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <AllowedHeader>*</AllowedHeader>
  </CORSRule>
</CORSConfiguration>
@satryacode
Copy link
Author

satryacode commented Aug 4, 2020

The culprit is on Authorization header value
Authorization: Bearer AWSAccessKeyId:Signature

meanwhile on AWS, their standard value is
Authorization: AWS AWSAccessKeyId:Signature
https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheAuthenticationHeader

Is there a way to change the value from ** Bearer ** to ** AWS ** ??
Is that a bug, or something I missed?

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