WebAuthn (Web Authentication) API implementation showcasing biometric and security key authentication using React and TypeScript.
- Passwordless authentication using WebAuthn
- Support for biometric authentication (TouchID, FaceID, Windows Hello)
- Security key support (USB, NFC)
- Responsive, mobile-first design
- Modern UI with Tailwind CSS
- Built with Vite for optimal performance
- Type-safe implementation with TypeScript
- Error handling and user feedback
- User guidance
- Industry use case examples
- Modern browser with WebAuthn support
- Node.js 18 or higher
- npm or yarn package manager
-
Clone the repository:
git clone [repository-url] cd webauthn-demo -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:5173
src/
├── lib/
│ └── webauthn.ts # WebAuthn implementation
├── App.tsx # Main application component
├── main.tsx # Application entry point
└── index.css # Global styles
-
Registration
- Generate challenge
- Create credentials with authenticator
- Store public key on server (mock implementation)
-
Authentication
- Generate challenge
- Verify credentials with authenticator
- Validate assertion
- Challenge-based authentication
- Secure credential storage
- HTTPS requirement
- User verification preferences
- Resident key support
- Cross-platform compatibility
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Lint code
- React 18
- TypeScript
- Vite
- Tailwind CSS
- Lucide React Icons
WebAuthn is supported in all modern browsers:
- Chrome 67+
- Firefox 60+
- Safari 13+
- Edge 18+
- Implements proper error handling
- Provides clear user feedback
- Follows WAI-ARIA accessibility guidelines
- Uses responsive design principles
- Implements proper TypeScript types
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Ed Bates (TECHBLIP LLC)
Some sections of this code were generated with the assistance of AI tools. These contributions were reviewed and integrated by the project creator(s).
Apache-2.0 license - see the LICENSE file for details
