A React-based web component that provides FIDO2/WebAuthn authentication for TeskaLabs SeaCat PKI. This component allows secure authorization of configured actions using biometric authentication, security keys, or other FIDO2-compatible authenticators.
- FIDO2/WebAuthn Support: Secure authentication using biometrics, security keys, or other FIDO2-compatible devices
- Multi-tenant Support: Configurable tenant-based authentication
- Authorization Flow: Secure authorization of specific actions within TeskaLabs SeaCat PKI
- Modern React: Built with React 19 and modern JavaScript features
- JSON Data Display: Built-in JSON editor for viewing authorization data
- Error Handling: Comprehensive error handling and user feedback
- Responsive Design: Clean, modern UI that works across devices
- Node.js 18+
pnpmpackage manager- Modern browser with WebAuthn support (Chrome, Firefox, Safari, Edge)
- Clone the repository:
git clone https://github.com/TeskaLabs/seacat-pki-webauthn.git
cd seacat-pki-webauthn- Install dependencies:
pnpm installpnpm devThe application will be available at http://localhost:5173
pnpm buildpnpm previewpnpm lintThe component expects the following URL parameters:
authid(required): 64-character hexadecimal authorization IDtenant(required): 2-64 character alphanumeric tenant identifiernext(optional): URL to redirect to after successful authorization
https://fido2.example.com/?authid=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef&tenant=mytenant&next=https://app.example.com/success
- Users registered their FIDO2/Webauthn tokens in the TeskaLabs SeaCat PKI.
-
The User executes an action that is submitted thru TeskaLabs SeaCat PKI API. The desired action is configured in the TeskaLabs SeaCat PKI to be authorized.
-
TeskaLabs SeaCat PKI API returns
401 UnauthorizedwithWWW-Authenticateheader set toFIDO2 <authid>. The body of such a response is as follows:{ "result": "AUTHORIZATION_REQUIRED", "authid": "235e241aaba02bf2fd0e3fac153e4aa282254d4fe1043f5cbe45d6010fcdbf49", "url": "https://fido2.example.com/?authid=235e241aaba02bf2fd0e3fac153e4aa282254d4fe1043f5cbe45d6010fcdbf49&tenant=rootca" } -
The user is forwarded to
url, add optionalnextparameter for a final user forward. -
User accesses the component with valid
authidandtenantparameters -
Authorization data is fetched and displayed in a JSON editor

-
User clicks "Authorize" to initiate FIDO2 authentication
-
Browser prompts for FIDO2 authenticator (biometric, security key, etc.)

-
Credential is verified and authorization is completed
-
User is redirected to the
nextURL if provided
If the autorization fails, the error message is displayed to the user and flow is stoped.
To integrate this component into other web applications:
- Build the component:
pnpm build-
Include the built files in your application
-
Navigate to the component with required parameters:
const authUrl = `/auth-component/?authid=${authid}&tenant=${tenant}&next=${encodeURIComponent(nextUrl)}`;
window.location.href = authUrl;IMPORTANT: This authorization component must be exposed on the same domain (DNS) as Web UI of TeskaLabs SeaCat PKI.
Ensure your TeskaLabs SeaCat PKI backend allows CORS requests from your application domain.
- React 19: Modern React with latest features
- Vite: Fast build tool and development server
- json-edit-react: JSON editor component for data display
- ESLint: Code linting and formatting
Modify src/index.css for global styles or add component-specific styles in App.jsx.
Customize error messages in the App.jsx component's error handling sections.
Update API endpoint URLs in App.jsx to match your TeskaLabs SeaCat PKI configuration.
-
"Invalid authorization" error
- Ensure
authidis exactly 64 hexadecimal characters - Check that the authorization hasn't expired
- Ensure
-
"Invalid tenant" error
- Ensure
tenantis 2-64 alphanumeric characters (including-and_)
- Ensure
-
FIDO2 authentication fails
- Verify browser supports WebAuthn
- Check that FIDO2 authenticator is properly configured
- Ensure HTTPS is used in production (WebAuthn requires secure context)
-
API errors
- Verify SeaCat PKI backend is running and accessible
- Check CORS configuration
- Ensure API endpoints are correctly configured
- Chrome: Full WebAuthn support
- Firefox: Full WebAuthn support
- Safari: Full WebAuthn support (macOS 10.15+, iOS 13.3+)
- Edge: Full WebAuthn support
BSD 3-Clause License, (C) TeskaLabs Ltd.
For support and questions, contact us at support@teskalabs.com.