I have a Python flask app which is using a Yubikey as a 2FA next to username and password.
While registering a new user I am registering the yubikey linked to that user and storing the credentials in a JSON file.
I need to store the Yubikey registration credentials to the same File for future logins of the user, using the Yubikey.
The Registration Credentials Look like this:
REGISTERED CREDENTIAL: AttestedCredentialData(
aaguid = AAGUID(00000000-0000-0000-0000-000000000000),
credential_id = b'ya\xaf\x98J\xb6\xe0\xd5\xe8|5c\xa2\x9e\xd7\x1c\x0c\xd5\x14\x1fT\x16\x8b\xb9^\x05\x11\xce\xec\x86\xb8\xe5\xc3\xeb\x03\xc2\x18\x05\x07\xb5\x19\rB\x1b\xaa\xcbU:\x93X\x12\x80=\xca\\\x06i\xcb\xc2p^\xe7\xa4H',
public_key = {
1: 2,
3: -7,
-1: 1,
-2: b'\x87A\xca]\xa7\xd7\xd1\xbb\xf1O=\x0c\x8b\xe9o\x84ONd\xffB\x9e\xf0\x0c\xd70K\xb5Z\xc8Rv',
-3: b'P\xba\xbcy,>\x08\xc1\x06W\x8ai\x84\xe0N,;:@\x82\xb2gx\x0b\xfd]\x13\x1e\xe5H\xdf('
}
)
When I try to serialize the above mentioned data and store it in JSON file it's getting stored, but while retrieving and using those I am getting a Error Not Enough Data to Unpack
in fido2 python package.
Please help me to resolve this Issue.