Authentication trong Laravel

04/01/2022   Laravel
Authentication trong Laravel
1. Guard Auth là gì, Guard Auth trong Laravel
- Guard Auth là cách thức (logic) để xác thực người dùng
- Có nhiều loại: dùng Session, Token, JWT, Passport, Sanctum
+ Session: https://laravel.com/docs/8.x/authentication#adding-custom-user-providers
+ Token: https://laravel.com/docs/5.8/api-authentication#protecting-routes
+ JWT: https://viblo.asia/p/laravel-8-su-dung-authentication-json-web-token-jwt-ByEZkjBYKQ0
+ Passport: https://laravel.com/docs/8.x/passport
+ SancTum: https://laravel.com/docs/8.x/sanctum
* Guard Auth dùng trong Laravel
- default: 'guard' => 'web',
+ có 'driver' => 'session',
+ Xem: /config/auth.php:39
2. Provider Auth là gì, Provider Auth trong Laravel
- Provider Auth là cách thức lấy data user từ DB
* Provider Auth trong laravel
- Có nhiều loại: Eloquent, Query Buider, Mongo...
+ Xem: /config/auth.php:63
3. Password Auth trong Laravel
- Password Auth là cách thức để reset password trong laravel

