99x / 99x/serverless-dynamodb-local

MissingAuthenticationToken

Open
#236 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
621
Forks
232
PR merge metrics
No merged PRs in 30d

Description

**Actual Behaviour**

A work friend has set up serverless dynamodb local, making a GET request to localhost works for her, but it doesn't for me. We have the same code, with the difference that I'm using a new laptop.

Whenever I `curl -v 'http://localhost:5001/users/123'`

I get
```
Connection #0 to host localhost left intact
{"__type":"com.amazonaws.dynamodb.v20120810#MissingAuthenticationToken","message":"Request must contain either a valid (registered) AWS access key ID or X.509 certificate."}* Closing connection 0
```

config.js
```
export const DB_CONFIG = {
region: process.env.AWS_REGION || 'localhost',
endpoint: process.env.DYNAMO_DB_ENDPOINT,
accessKeyId: process.env.AWS_ACCESS_KEY_ID || 'DEFAULT_ACCESS_KEY',
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || 'DEFAULT_SECRET',
sessionToken: process.env.AWS_SESSION_TOKEN
}
```

.env.yml
```
local:
AWS_REGION: 'localhost'
DYNAMO_DB_ENDPOINT: 'http://localhost:8000'
AWS_ACCESS_KEY_ID: 'DEFAULT_ACCESS_KEY'
AWS_SECRET_ACCESS_KEY: 'DEFAULT_SECRET'
AWS_SESSION_TOKEN: 'DEFAULT_SESSION_TOKEN'
USERS_TABLE_NAME: 'name-of-our-table-local'

sandbox:
USERS_TABLE_NAME: 'name-of-our-table-sandbox'
```

I don't really know how to solve that issue.

Contributor guide

Open the contributing guide

Research direction

Start with config.js and .env.yml, then reproduce the curl request against the local endpoint while comparing the local configuration with the working setup described in the issue. Done means the GET request to localhost returns the expected user response instead of MissingAuthenticationToken.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.