STING Passkey Implementation Guide
This guide explains how to use WebAuthn/passkeys as the primary authentication method in STING, along with how to resolve common authentication issues.
Passkey Authentication in STING
We’ve configured Kratos to support passwordless WebAuthn (passkeys) as a primary authentication method. This offers several advantages:
- Enhanced Security: Passkeys are phishing-resistant and more secure than passwords
- Improved User Experience: No passwords to remember or type
- Platform Integration: Works with Apple, Google, and Windows authentication systems
- Biometric Verification: Uses fingerprint, face recognition, or device PIN
Configuration Changes
The following changes have been made to enable passkey authentication:
Kratos Configuration Update:
# In main.kratos.yml methods: webauthn: enabled: true config: rp: id: localhost display_name: STING Authentication origins: - https://localhost:8443 - https://localhost:4433 passwordless: true # Enable passwordless login with passkeysReact Components for Passkey Authentication:
EnhancedKratosLogin.jsx: Prioritizes passkey login while maintaining password as fallbackEnhancedKratosRegistration.jsx: Guides users through registration with passkey setup
Updated Routing:
- Routes configured to use the enhanced components
- Proper handling of flow IDs in login URLs
Testing Passkey Authentication
To test passkey authentication:
Start the STING services:
./manage_sting.sh startAccess the login page: Visit https://localhost:8443/login
Choose “Sign in with Passkey”: If your device supports WebAuthn, you’ll be prompted to use your biometric or device PIN
Register a new passkey: If you don’t have a passkey yet, complete registration first at https://localhost:8443/register
Troubleshooting Common Issues
Authentication Issues
If you experience 404 errors or other authentication issues:
- Check the browser console for errors related to authentication or CORS
- Ensure proxy settings are correct in
frontend/src/setupProxy.js - Verify your browser supports WebAuthn - Chrome, Firefox, Safari, and Edge should work
- Try the debug page at https://localhost:8443/debug to diagnose Kratos connectivity
Dashboard Not Appearing
If the dashboard doesn’t appear after authentication:
- Check Kratos session status using the debug page
- Verify MainInterface.js is correctly checking for authentication
- Try the mock user option by uncommenting the
createMockUser()line in MainInterface.js
Passkey Detection Issues
If passkeys aren’t being detected:
- Ensure your device has biometric capabilities or a secure PIN
- Check browser permissions for biometric access
- Try a different browser to see if it’s a browser-specific issue
Fallback Options
Even with passkeys enabled, these fallback methods are still available:
- Password Authentication: Traditional email/password login remains available
- Legacy Login Page: Available at
/login-legacyfor backward compatibility
Technical Documentation
For a deeper understanding of the integration, see: