API headers not signed when AWS_PROFILE env var is set
See original GitHub issueI have a local node script used for testing our AWS Amplify app. Another product that I use requires the AWS_PROFILE
env var to be set. This causes the local profile to be picked up while calling Auth.signIn
which then causes a call to API.graphql
to not set the x-amz-date
and x-amz-security-token
headers.
Steps to reproduce the behavior:
- Run
export AWS_PROFILE=...
pointing to custom profile in ~/.aws/credentials Auth.Config({ identityPoolId: XXX, region: XXX, userPoolId: XXX, userPoolWebClientId: XXX })
Auth.signIn(...)
API.graphql(...)
- API gateway will throw a 403 error due to missing
x-amz-date
andx-amz-security-token
headers
- MacOS 10.14.3
- aws-amplify 1.1.26
The fix is quite simple, just unset AWS_PROFILE
, but it would be great if aws-amplify would ignore this env var or if it were documented somewhere.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Environment variables to configure the AWS CLI
Environment variables provide another way to specify configuration options and credentials, and can be useful for scripting or temporarily setting a named ...
Read more >Configuration — Boto3 Docs 1.26.35 documentation
A Config object that's created and passed as the config parameter when creating a client; Environment variables; The ~/.aws/config file. Note. Configurations ...
Read more >Configuring the AWS SDK for Go V2
In the AWS SDK for Go V2, you can configure common settings for service ... Set the AWS_REGION environment variable to the default...
Read more >Missing credentials in config, if using AWS_CONFIG_FILE, set ...
By default, the SDK detects AWS credentials set in your environment and uses them to sign requests to AWS. That way you don't...
Read more >Serverless Offline - Serverless Framework: Plugins
Custom headers; Environment variables; AWS API Gateway Features ... When no Content-Type header is set on a request, API Gateway defaults to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mikelduffy - Thanks. The aws-sdk loads the credentials from the environment variable, and this sdk is one of the Amplify dependencies. We are reviewing this issue.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.