User Auth with JSON Web Tokens | Build Starter Kit for Single Page Apps #2

Опубликовано: 01 Январь 1970
на канале: Creative Bracket • Dart and Flutter Tutorials
4,891
139

We will be resuming the starter kit for single page applications, implementing an AuthApi router for handling registration and authentication of users. We will learn how we can authorise logged in user using JSON Web Tokens(JWT). JWTs are an open, industry standard method for representing credentials or “claims” securely between two parties. We will use MongoDB as our datastore for persisting our registered users.

We will use the Envify package for managing our MongoDB connection strings and generated secret keys. We will learn the standard way of saving passwords, involving the creation of a randomly generated “salt” as well as a hashing function for securely encrypting our password. We will learn how to utilise the power of shelf middleware functions for checking our JWTs during the request and response lifecycle, protecting our UserApi routes. We will finish off by implementing a Static Assets Api for managing our static assets like stylesheets and images.

=== Contents of this video ===

00:00 Intro
00:24 Implement Auth API router class
02:15 Setup and Connect to MongoDB database
03:40 Handle configuration with Envify package
06:24 Handle imports from library file
07:06 Implement Auth registration endpoint
09:23 Generate salt and hash our user password
12:12 Implement Auth login endpoint
14:17 Write JSON Web Token generation and validation functions
17:14 Create middleware to protect our UserApi endpoint
23:25 Implement Auth logout endpoint
24:58 Implement StaticAssetsApi router
27:22 Refactor catch all index.html route with fallback function
28:37 Outro

Please leave us your feedback in the comments, and let us know what you would like us to demonstrate next! You can reach out in the comments below or on Twitter using #FullstackDart #Dartlang #DartStarterKit #Flutter

Like, Subscribe and Hit the Bell 🔔 if you enjoyed this video 😍

Get the source code → https://github.com/graphicbeacon/dart...
Get started with Dart course → https://bit.ly/getstartedwithdart

Dart docs → https://dart.dev
Subscribe to the channel → http://bit.ly/2P2N1jC

Read More Dart Tutorials → https://creativebracket.com
Buy me a coffee → https://ko-fi.com/creativebracket

LET'S CONNECT
---
Twitter →   / creativ_bracket  
Support the channel →   / creativebracket  


Смотрите видео User Auth with JSON Web Tokens | Build Starter Kit for Single Page Apps #2 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Creative Bracket • Dart and Flutter Tutorials 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 4,89 раз и оно понравилось 13 людям.