Git Product home page Git Product logo

u3_hw_jwt_auth_study's Introduction

Authentication Study

Please take the time to read this article before proceeding.

Instructions

  • Fork and Clone

Write your answers in the space provided in this readme.

A Note on Passwords

We never store passwords in our database. Instead, we use a hashing function to create a password hash or digest. We store the password digest in our database.

JSON Web Token (JWT) Authentication

Here is a flow for using JWT for Authentication

  1. The user signs up:
  • The client creates a POST request to the /signup endpoint on the server with username, email, and password in the request body
  1. The server creates a JSON Web Token (JWT) based on a header, payload, and secret
  2. The server responds with the JWT
  3. The client saves the JWT in localStorage to persist subsequent server requests

Answer the following questions:

  1. Why do we need authentication in our Web Apps?
To ensure that each user has their own private experience.
  1. What is the point of a JSON Web Token? Why would we want to use it?
The point of a JWT is to securely transmit information between parties. We would want to use it because its digital signature means that it can be "verified and trusted".
  1. Why would we hash a user's password when they sign up? What's the point?
It encrypts the user's information (in this case password) to make it more secure.
  1. Go here. Create a JWT with the following as the payload (feel free to change the username/email):
{
  "id": "1",
  "username": "bruno",
  "email": "[email protected]"
}

Paste your encoded JWT below:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEiLCJ1c2VybmFtZSI6ImJydW5vIiwiZW1haWwiOiJicnVub0BnYS5jbyJ9.SNHM7vL6ehTkvM4Rg-IH-SanpKkCN3KtQ68qESpkcZU

Bonus: Read https://blog.angular-university.io/angular-jwt

Submission

Submit a pull request utilizing the PR Template

u3_hw_jwt_auth_study's People

Contributors

nobodyslackey avatar anpato avatar katimperial avatar ahonore42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.