# Serverless Error - The security token included in the request is invalid

**URL:** <https://forum.serverless.com/t/serverless-error-the-security-token-included-in-the-request-is-invalid/2219>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [July 5, 2017, 7:13pm UTC](https://forum.serverless.com/t/serverless-error-the-security-token-included-in-the-request-is-invalid/2219 "2017-07-05T19:13:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jairomarcel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jairomarcel/32/779_2.png) [@jairomarcel](https://forum.serverless.com/u/jairomarcel)\
**Post date:** [July 5, 2017, 7:13pm UTC](https://forum.serverless.com/t/serverless-error-the-security-token-included-in-the-request-is-invalid/2219/1 "2017-07-05T19:13:22Z")

</div>

Hello.

I’m doing this tutorial [https://serverless.com/blog/node-rest-api-with-serverless-lambda-and-dynamodb/](https://serverless.com/blog/node-rest-api-with-serverless-lambda-and-dynamodb/) but when I get to the part to deploy the application with **sls deploy** I get the message below:

```
$ serverless deploy
Serverless: Packaging service...

Serverless Error ---------------------------------------

ServerlessError: The security token included in the request is invalid.

Get Support --------------------------------------------
   Docs: docs.serverless.com
   Bugs: github.com/serverless/serverless/issues
   Forums: forum.serverless.com
   Chat: gitter.im/serverless/serverless

Your Environment Information -----------------------------
   OS: win32
   Node Version: 6.9.1
   Serverless Version: 1.17.0

```

The file serverless.yml is the same as showed in the tutorial:

```
service: candidate-service

frameworkVersion: ">=1.1.0 <2.0.0"

provider:
  name: aws
  runtime: nodejs4.3
  stage: dev
  region: us-east-1

functions:
  candidateSubmission:
    handler: api/candidates.submit
    memorySize: 128
    description: Submit candidate information and starts interview process.
    events:
      - http: 
          path: candidates
          method: post

```

How can I fix this, where I add the token and what is this token, the access key?

---

<div class="post-metadata">

**Author:** ![DavidWells](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/davidwells/32/201_2.png) [@DavidWells](https://forum.serverless.com/u/DavidWells)\
**Post date:** [July 6, 2017, 12:00am UTC](https://forum.serverless.com/t/serverless-error-the-security-token-included-in-the-request-is-invalid/2219/2 "2017-07-06T00:00:47Z")

</div>

Looks like your AWS credentials aren’t configured on your machine.

Double check they are setup

Here is the guide on configuring those [https://serverless.com/framework/docs/providers/aws/guide/credentials/](https://serverless.com/framework/docs/providers/aws/guide/credentials/)

---

<div class="post-metadata">

**Author:** ![CesarsEren](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/cesarseren/32/6265_2.png) [@CesarsEren](https://forum.serverless.com/u/CesarsEren)\
**Post date:** [October 12, 2021, 5:04am UTC](https://forum.serverless.com/t/serverless-error-the-security-token-included-in-the-request-is-invalid/2219/3 "2021-10-12T05:04:34Z")

</div>

Ty man, I just needed to change my secret key 😃

---

<div class="post-metadata">

**Author:** ![sjatkins](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/sjatkins/32/3796_2.png) [@sjatkins](https://forum.serverless.com/u/sjatkins)\
**Post date:** [November 25, 2021, 6:47pm UTC](https://forum.serverless.com/t/serverless-error-the-security-token-included-in-the-request-is-invalid/2219/4 "2021-11-25T18:47:24Z")

</div>

In my case I am on aws sso credentials. It is refreshed. The ~/.aws/credentials is up to date which includes a token. I understand serverless looks there and ignores ~/.aws/config. But it does not work with --aws-profile or without it but with sls config credentials either. Very annoying. Strange thing is it was working fine 12 hours ago and today there is no luck at all.

---

<div class="post-metadata">

**Author:** ![hastingsr](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/hastingsr/32/6745_2.png) [@hastingsr](https://forum.serverless.com/u/hastingsr)\
**Post date:** [April 13, 2022, 1:30pm UTC](https://forum.serverless.com/t/serverless-error-the-security-token-included-in-the-request-is-invalid/2219/5 "2022-04-13T13:30:59Z")

</div>

I’m getting the same error. Were you able to deploy?

---

<div class="post-metadata">

**Author:** ![Cconkers](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/cconkers/32/7800_2.png) [@Cconkers](https://forum.serverless.com/u/Cconkers)\
**Post date:** [February 11, 2024, 11:04am UTC](https://forum.serverless.com/t/serverless-error-the-security-token-included-in-the-request-is-invalid/2219/6 "2024-02-11T11:04:30Z")

</div>

Delete line:

region: us-east-1

and try again
