Dan2024 / auth-request-flow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Authenticating HTTP Requests

Learning Objectives

  • Use bearer token authentication to protect an API resource

Introduction

In this exercise, you're going to build a small but complete bearer token authentication system. Here's a reminder for the flow:

  1. The client sends a request containing login credentials to the server.
  2. The server checks the credentials are correct and sends back a token.
  3. The client sends a request to a secure resource, putting the token in the authorization header of the request.
  4. The server verifies that the token is valid and sends back the requested resource, or an error message if the token wasn't valid.

Here's the diagram again to help you visualise this flow:

Instructions

  1. Fork this repository and clone the fork.
  2. Run npm ci to install dependencies.
  3. Run npm start to run the application.
  4. Complete each requirement in the requirements directory in numerical order.

About


Languages

Language:JavaScript 100.0%