bind
Performs the complete device binding operation.
This is the main method that orchestrates the entire device binding process:
Validates device support for the specified authentication type
Clears any existing keys for the user
Generates a new cryptographic key pair with optional attestation
Authenticates the user based on the configured authentication type
Signs a JWT with the generated key to prove possession
Stores the user key metadata for future use
Handles cleanup on failures
The operation is performed within a timeout to prevent indefinite blocking. If authentication fails or any step encounters an error, all created keys are automatically cleaned up.
Return
A Result containing the signed JWT on success, or an error on failure
Parameters
Optional configuration block to customize the device binding behavior
Throws
if the device doesn't support the authentication type
if the operation exceeds the timeout