|
|
@@ -35,7 +35,7 @@ This is a full-stack demonstration of **passwordless authentication using WebAut
|
|
|
### 1. Clone or Download the Project
|
|
|
|
|
|
Download this project from Google Drive or clone it if hosted on Git later.
|
|
|
-https://chat.google.com/dm/hDsHMQAAAAE/79WHykPDGEQ/79WHykPDGEQ?cls=10
|
|
|
+https://drive.google.com/file/d/1isU4QjH3Vz30y4SXM2RRt2zgkl02No4j/view?usp=sharing
|
|
|
```bash
|
|
|
cd your-project-directory
|
|
|
```
|
|
|
@@ -66,3 +66,37 @@ in ..\Mobile Authentication Sample\sample-auth-backend run npm run start
|
|
|
|
|
|
|
|
|
|
|
|
+### 🔐 Setting up Trusted Local HTTPS with mkcert
|
|
|
+
|
|
|
+1. Install mkcert
|
|
|
+ powershell> choco install mkcert
|
|
|
+ powershell> mkcert -install
|
|
|
+ (Run PowerShell as Administrator to ensure root CA is installed.)
|
|
|
+
|
|
|
+2. Create a certs folder in your backend directory
|
|
|
+ powershell> cd E:\Task\Mobile Authentication Sample\sample-auth-backend
|
|
|
+ powershell> mkdir certs
|
|
|
+
|
|
|
+3. 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.)
|
|
|
+
|
|
|
+4. 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<NestExpressApplication>(AppModule, { httpsOptions });
|
|
|
+
|
|
|
+5. Restart your browser
|
|
|
+ Access https://localhost:3000 or https://<LAN-IP>:3000 (must match SAN).
|
|
|
+
|
|
|
+Notes:
|
|
|
+- Chrome/Edge trusts Windows root store automatically.
|
|
|
+- Firefox may require manually importing rootCA.pem from mkcert -CAROOT.
|
|
|
+- Always regenerate certs if changing hostnames or LAN IPs.
|
|
|
+
|