Token Based Authentication

Brief Vocabulary Lesson

​JSON - JavaScript Object Notation

{
  "username": "clangager",
  "firstName": "Chris",
  "lastName": "Langager",
  "roles": [
    "procurement",
    "inventory",
    "recipes"
  ]
}

​JWT - JSON Web Token

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNsYW5nYWdlciIsImZpcnN0TmFtZSI6IkNocmlzIiwibGFzdE5hbWUiOiJMYW5nYWdlciIsInJvbGVzIjpbInByb2N1cmVtZW50IiwiaW52ZW50b3J5IiwicmVjaXBlcyJdfQ.czPcIVb6rYKvZOV9QWtKACGMhFX_BY5N7NJmiWTdxso

Authentication

API

Inventory

API

username & password

access token

access token

inventory data

Logbook

API

access token

inventory data

access token

Token Validation

(this is what the APIs do)

  1. Was this token issued by the Auth API?
  2. Were the claims tampered with?
  3. Is the token expired?

Token Based Authentication

By Chris Langager

Token Based Authentication

  • 267