question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API headers not signed when AWS_PROFILE env var is set

See original GitHub issue

I 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:

  1. Run export AWS_PROFILE=... pointing to custom profile in ~/.aws/credentials
  2. Auth.Config({ identityPoolId: XXX, region: XXX, userPoolId: XXX, userPoolWebClientId: XXX })
  3. Auth.signIn(...)
  4. API.graphql(...)
  5. API gateway will throw a 403 error due to missing x-amz-date and x-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:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
haverchuckcommented, Apr 19, 2019

@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.

0reactions
github-actions[bot]commented, Jun 12, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found