This is the second in our series of tutorials that are meant for the novice developer as Angular 7 tutorials for beginners. For advanced Angular 7 developers stuck with a development issue in a project this could come in handy especially if you are tasked with providing security for an existing web application.
This implements ANGULAR 7 VALIDATION AND AUTHORIZATION using industry standard JWT tokens.
The code uses Angular Material Design to build a login form with -A regular username text field -A password field with masked characters
Among Angular Material components is mat-icons used in fields, Angular Material Buttons showing you how to make them enabled or disabled based on form validation status.
We'll show how how to user the Angular guard to protect pages and restrict them to authorized users only.
Tutorials in the series availabe in YouTube:
- Installing Angular 7, Angular Material Design : https://youtu.be/sKe-sA7ypFI
- Angular JWT Authentication https://youtu.be/re0JHmK5_OM
Thank you and welcome.
For a blog on this tutorial please visit us at http://pmkent.com/index.php/angular-authentication-with-jwt/
User
This project was generated with Angular CLI version 7.1.0.
Development server
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Code scaffolding
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Build
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Running unit tests
Run ng test
to execute the unit tests via Karma.
Running end-to-end tests
Run ng e2e
to execute the end-to-end tests via Protractor.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.