Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Passport JWT tutorial - Authentication with JSON Web Tokens

  • Seeker Labs
  • 2022-11-06
  • 12842
Passport JWT tutorial - Authentication with JSON Web Tokens
Passport JWT TutorialPassport.js JWT TutorialPassport and JSON Web TokensPassport and JWT for beginnersJWT TutorialLearn Passport & JWT
  • ok logo

Скачать Passport JWT tutorial - Authentication with JSON Web Tokens бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Passport JWT tutorial - Authentication with JSON Web Tokens или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Passport JWT tutorial - Authentication with JSON Web Tokens бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Passport JWT tutorial - Authentication with JSON Web Tokens

Source Code: https://truthseekers.io/passport-js-t...

In this Passport JWT Tutorial we go through authentication with Passport and JSON Web Tokens step by step. The first thing we do is look at JSON Web Tokens by themselves, without any passport.js code.

A JWT is just a jumbled string that when decoded contains some piece of identifying data. So, you could store an entire user object, or just the ID. When you create the token, you're also adding a "secret key" to the mix that is used in the formula to jumble the string. Without that "secret key" you won't be able to decode the string.

This is useful for security, and it also makes it easier to share the JWT across multiple domains and applications. All you need to do is use the same secret key across apps that you want to share login for. If the secret key changes at all, then all the tokens using it will break.

Once the server has created the token, we give that token to the client, and they store it somewhere "safe" (Like LocalStorage?). On every request, or every request where they're trying to access "secure" routes, the token is passed along with the request to the server in the HEADERS. The server will see the token and try to decode it. If the server is able to decode the data properly, it will use the decoded data to handle the rest of the request. For example, getting a list of the user's recipes from the database based on the ID of the user in the decoded JWT.

When you throw Passport.js into the equation, it's not much harder to understand. Passport.js provides a "Local Strategy" for users to enter their signup/login information. Passport provides you a function to allow you to determine if the users entered info meets your criteria and matches any records in the database. If the user is signing up, you create a function to make sure the password meets the criteria, there's no existing user with that email, etc. If all is good you pass to Passport's callback function.

From the callback function you take the error, user object, and optional message object and process that how you like. If all is good you log them in by creating a JWT. Otherwise you throw an error and redirect.

Once you give the JWT to the "client", the next step is to "lock down" any routes that require authorization / authentication. This is where Passport's JWT strategy comes into the picture.
The Passport JWT acts as a "lock" to all the routes requiring a user to be logged in. So any time a user wants to visit a secured area of the site, they have to pull out their JWT, and give it to the JWT strategy, which decodes the JWT and allows them in or rejects them.

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]