2025-10-19 00:05:16 +01:00
|
|
|
# MFA Commands Quick Reference
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
2026-03-11 03:22:42 +00:00
|
|
|
```nushell
|
|
|
|
|
bash
|
2025-10-19 00:05:16 +01:00
|
|
|
# Build plugin
|
|
|
|
|
cargo build --release
|
|
|
|
|
|
|
|
|
|
# Register with Nushell
|
|
|
|
|
plugin add ./target/release/nu_plugin_auth
|
|
|
|
|
plugin use auth
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Commands
|
|
|
|
|
|
|
|
|
|
### TOTP Enrollment
|
|
|
|
|
|
2026-03-11 03:22:42 +00:00
|
|
|
```nushell
|
|
|
|
|
bash
|
2025-10-19 00:05:16 +01:00
|
|
|
# Enroll with QR code
|
|
|
|
|
auth mfa enroll totp
|
|
|
|
|
|
|
|
|
|
# For specific user
|
|
|
|
|
auth mfa enroll totp --user alice
|
|
|
|
|
|
|
|
|
|
# Custom Control Center URL
|
|
|
|
|
auth mfa enroll totp --url http://control.example.com:8081
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**Output**: QR code + secret + backup codes
|
|
|
|
|
|
|
|
|
|
### TOTP Verification
|
|
|
|
|
|
2026-03-11 03:22:42 +00:00
|
|
|
```nushell
|
|
|
|
|
bash
|
2025-10-19 00:05:16 +01:00
|
|
|
# Verify code
|
|
|
|
|
auth mfa verify --code 123456
|
|
|
|
|
|
|
|
|
|
# For specific user
|
|
|
|
|
auth mfa verify --code 123456 --user alice
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**Output**: `{valid: true/false, message: "..."}
|
|
|
|
|
|
|
|
|
|
## Complete Workflow
|
|
|
|
|
|
2026-03-11 03:22:42 +00:00
|
|
|
```nushell
|
|
|
|
|
bash
|
2025-10-19 00:05:16 +01:00
|
|
|
# 1. Login
|
|
|
|
|
auth login admin --save
|
|
|
|
|
|
|
|
|
|
# 2. Enroll MFA
|
|
|
|
|
auth mfa enroll totp
|
|
|
|
|
# Scan QR code with Google Authenticator or Authy
|
|
|
|
|
|
|
|
|
|
# 3. Verify code from app
|
|
|
|
|
auth mfa verify --code 123456
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
|
|
|
|
|
- **Full Documentation**: `MFA_IMPLEMENTATION_SUMMARY.md`
|
|
|
|
|
- **Verification Report**: `VERIFICATION.md`
|
|
|
|
|
- **Examples**: `examples/mfa_workflow.nu`
|
|
|
|
|
|
|
|
|
|
## Status
|
|
|
|
|
|
|
|
|
|
✅ **Complete and Ready for Testing**
|
|
|
|
|
|
|
|
|
|
- Binary: `target/release/nu_plugin_auth` (11MB)
|
|
|
|
|
- Commands: 6 total (2 new MFA commands)
|
|
|
|
|
- Build: Success (28.58s)
|
2026-03-11 03:22:42 +00:00
|
|
|
- Dependencies: totp-rs 5.7, qrcode 0.14
|