https://github.com/nprail/static-auth-poc
🔑 Authentication middleware for static websites (POC)
https://github.com/nprail/static-auth-poc
authentication authorization middleware static-site
Last synced: about 2 months ago
JSON representation
🔑 Authentication middleware for static websites (POC)
- Host: GitHub
- URL: https://github.com/nprail/static-auth-poc
- Owner: nprail
- Created: 2018-04-26T19:16:49.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T13:01:57.000Z (over 7 years ago)
- Last Synced: 2025-12-26T08:36:06.623Z (6 months ago)
- Topics: authentication, authorization, middleware, static-site
- Language: JavaScript
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Static Site Auth (POC)
## Instructions
Clone the repo.
```bash
git clone git@github.com:nprail/static-auth-poc.git
cd static-auth-poc
```
Install the dependencies.
```bash
npm install
```
Start the proxy and login server.
```bash
npm start
```
Browse to http://localhost:3000
- **Username:** demo@example.com
- **Password:** demo
## Components
### Proxy Server
The proxy server simply proxies the a site and adds middleware that verifies that the token exists and is valid.
### Login Server
The login server hosts the login page and acts as the login API.
## Flow
1. User goes to a password protected site (e.g. protected.example.com)
2. User is redirected to the Login Server and logs in
3. User is redirected back to protected.example.com with new JWT token stored in a cookie
4. The JWT token is then used to verify that the user has access to the site