For testing new concepts and ideas
|
|
6 days ago | |
|---|---|---|
| src | 6 days ago | |
| test | 5 months ago | |
| .gitignore | 3 weeks ago | |
| .prettierrc | 5 months ago | |
| README.md | 2 months ago | |
| analyze.prompt | 1 month ago | |
| eslint.config.mjs | 5 months ago | |
| nest-cli.json | 1 week ago | |
| package-lock.json | 1 week ago | |
| package.json | 1 week ago | |
| test.prompt | 1 month ago | |
| tsconfig.build.json | 6 days ago | |
| tsconfig.json | 2 months ago |
This is a full-stack demonstration of passwordless authentication using WebAuthn passkeys, built with:
| Layer | Tech |
|---|---|
| Frontend | Angular 20, Angular Material |
| Backend | NestJS |
| Auth | @simplewebauthn/server + browser |
| Hosting | NestJS serves Angular build |
| Tunnel | ngrok for HTTPS development |
Download this project from Google Drive or clone it if hosted on Git later. https://drive.google.com/file/d/1isU4QjH3Vz30y4SXM2RRt2zgkl02No4j/view?usp=sharing
cd your-project-directory
dependencies already installed in this case. just extract the program.
setup: https://dashboard.ngrok.com/get-started/setup/windows npx ngrok http 3000 Copy the exposed Url
Update the URLs ..\Mobile Authentication Sample\sample-auth-backend\src\config.ts Update the URL ..\Mobile Authentication Sample\web-app\src\app\config.ts
npm run nest This will enable NestJS to serve the frontend statically
in ..\Mobile Authentication Sample\sample-auth-backend run npm run start
Install mkcert powershell> choco install mkcert powershell> mkcert -install (Run PowerShell as Administrator to ensure root CA is installed.)
Create a certs folder in your backend directory powershell> cd E:\Task\Mobile Authentication Sample\sample-auth-backend powershell> mkdir certs
Generate a trusted certificate powershell> mkcert -cert-file certs\local-cert.pem -key-file certs\local-key.pem localhost 127.0.0.1
Optional LAN access: powershell> mkcert -cert-file certs\lan-cert.pem -key-file certs\lan-key.pem localhost 127.0.0.1 192.168.1.50
(Make sure hostname/IP matches certificate SAN.)
Update NestJS to use HTTPS ts> const httpsOptions = { key: fs.readFileSync(join(dirname, '..', 'certs', 'local-key.pem')), cert: fs.readFileSync(join(dirname, '..', 'certs', 'local-cert.pem')), }; ts> const app = await NestFactory.create(AppModule, { httpsOptions });
Restart your browser Access https://localhost:3000 or https://:3000 (must match SAN).
Notes: