Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 605 Bytes

File metadata and controls

54 lines (37 loc) · 605 Bytes

AspNetCore-JWT-Sample

Prerequisites:

  • Docker
  • Swarm

Setup

To build all container images:

docker-compose build

Deploy the stack:

docker stack deploy -c docker-compose.yml token

Usage

Call

POST http://localhost:5000/api/token
{
    "username" : "mickey",
    "password" : "mouse"
}

To get the token:

{
    "token": "<JWT-TOKEN>"
}

Add the token as Bearer Authorization header

Authorization: Bearer <JWT-TOKEN>

To get:

GET http://localhost:5001/api/cars/

Play around