'most simple way to password protect a web page in angular material
I have a question regarding how to password protect a web page. I used angular material to create a webpage that will talk to back-end service to query information. I also add an admin sub-page to do website configuration.
I'd like to make the admin page protected by password. This protection can be a very simple security feature, nothing complicated is required. Just a token that only a few people knows, once they enter the valid token the admin page will show.
I looked a few ways:
- .htaccess and .htpassword
- embed a java script as header in admin.component.html
- angular router link authentication
1 and 2 do not work for me 3 seems to be an overkill for my requirement.
Any idea how to make a simple password protected webpage? Also if I have to go with 3, it will protect any page re-routed to admin page. However if I directly enter www.mysite.com/admin, will it still be protected?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
