Post Your Answer
7 years ago in Discussion By Manasa
Authenticate angular 4 application
Can Jwts used to authenticate angular 4 applications? Quick response will be appreciated.
All Answers (5 Answers In All)
Reply to Deepthi G
Reply to Manasa
By Deepthi G Answered 7 years ago
You have to send your credentials to the server which will be verified by the database credentials. If it is verified without any issue, the JWT will is sent back to you.
JWT will be saved in your browser in local storage or in a cookie.
JWT saved in the browser will be used as an indicator that you are currently logged in.
The due time of JWT will be checked regularly to maintain an authenticated state within the Angular applications.
The client side routes will be protected and accessed only by authenticated users.
When you send XHR requests for APIs, the JWT will receive an authorization header using your cookies.
When XHR requests are appearing on the server, before sending back the responses, it will validated with the app’s secret keys.
You can also visit https://www.code-sample.com/2017/10/jwt-authenticate-angular-4-applications.html for more information.
Reply to Deepthi G
By Manasa Answered 7 years ago
Reply to Manasa
By Deepthi G Answered 6 years ago
Reply to Deepthi G
Related Questions