Aws-sam-cli: Global AllowCredentials is not working with localhost / local server

Created on 28 Nov 2019  路  8Comments  路  Source: aws/aws-sam-cli

Globals:
  Api:
    Cors:
      AllowOrigin: "'http://localhost:9000'"
      AllowCredentials: "'true'"
      AllowMethods: "'GET,POST'"
      AllowHeaders: "'*'"

I have seen this: https://github.com/awslabs/serverless-application-model/issues/1166

But AllowCredentials is definitely not working for either true, "true" or "'true'". Since this is a very important setting, not sure why no one is raising this up.

All other cors settings work without problem, just AllowCredentials.

arelocastart-api

Most helpful comment

@dz902 I hadn't noticed it was reverted. I reached out on the revert pull request (#1664) to see why.

All 8 comments

Just found that the same template is working when deployed to AWS, just not working locally. Very strange. Does that have anything to do with the local server?

Just found it's something missing from the server: https://github.com/pallets/werkzeug/issues/131

Anything we can do to enable credentials to test locally?

I'm also running into this issue. I set cookies in my API but the cookies won't persist in the browser since the Access-Control-Allow-Credentials header doesn't return true from the OPTIONS request. I think this is necessary to have.

WIP PR #1648 is approved. We need someone to complete unit and integration tests for the change before it can be released

Just wanted to follow up here and see if anyone has a workaround for this. Currently running aws-sam-cli v0.40.0 and can't get the AllowCredentials: true header to be provided in the response no matter what I try.

It seems the PR was reverted somehow. As of v0.47.0, this problem persists.

Not sure how others are using SAM and API Gateway, but without this almost no Web applications can be developed and tested in browser locally.

Why isn't this issue a high priority? Not many folks doing some serious Serverless Web business...? 馃

@dz902 I hadn't noticed it was reverted. I reached out on the revert pull request (#1664) to see why.

Just ran into this issue recently. It is blocking local testing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joekiller picture joekiller  路  4Comments

cvuijst picture cvuijst  路  3Comments

cmccoypdx picture cmccoypdx  路  3Comments

terlar picture terlar  路  3Comments

GerbenRampaart picture GerbenRampaart  路  3Comments