This Python script implements a new authentication system using passkeys for users. Passkeys are generated, encrypted, and stored along with user information. Users can register devices, generate passkeys, and login using their passkeys.
- Passkey Generation: Generates random passkeys for users.
- Passkey Encryption: Encrypts passkeys for secure storage.
- Device Registration: Allows users to register devices for authentication.
- Login Authentication: Validates users' login attempts based on passkeys and registered devices.
- Ensure you have Python installed on your system.
- Running the Application:
- Run the Python script using the following command:
python passkey.py
- Enter your username, email, and device ID when prompted.
- The script will generate a passkey, register the device, and attempt to login.
#Endpoint
POST /generate-passkey:
- Generates a passkey for the given user.
- Returns the generated passkey.
The passkeys are encrypted before storage for enhanced security.
Ensure to handle passkeys and user data securely to prevent unauthorized access. Implement additional security measures as needed for production use.