-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
store database #34
Comments
you have some sample code? I go with something like this: //do process create with the needed parameters and feed the result object into $data
$data = $WebAuthn->processCreate($clientDataJSON, $attestationObject, $challenge,($uv==="required"));
$data->credentialId=base64_encode($data->credentialId); //base64 encode the cred-ID
$data->AAGUID=bin2uuid($data->AAGUID); //external function to format binary AAGUID into an actual guid format
$data->signatureCounter=($data->signatureCounter === NULL ? 0 : $data->signatureCounter); //check whether the sig counter is actually a value, if not, set zero
//optional: $data->certificate is the cert. now you have basically 3 or 4 things to throw into the database. |
You can show this function bin2uuid, I'm trying to deploy in my project! tks |
sure I just got it off of someone online like stackoverlow or whatever, but dunno where exactly. function bin2uuid($bin) {
$uuidReadable = unpack("H*",$bin);
$uuidReadable = preg_replace("/([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})/", "$1-$2-$3-$4-$5", $uuidReadable);
$uuidReadable = array_merge($uuidReadable)[0];
return $uuidReadable;
} |
tks for the tip, can you help me to deploy this project on my system? |
I'm storing the credentialId as base64 on my database as @My1 kindly showed here, but when I pass that ids to getGetArgs, webauthn fails in the browser side. When I check in the ajax with the "getGetArgs", the ids look empty, something like: "=?BINARY?B?credentialId?=". Looks like getGetArgs only work when stored in $_SESSION |
@marcomtz85 |
@My1 y base64_decode them. Is it necessary something else? |
Make sure it's an array even if there's just one element inside. So in the end it's an array with binary strings inside. I use array_walk with a pass-by-reference base64 decode wrapper for that |
Hi!
I'm trying to save to database and it doesn't work. When I store "credentialId" a value is saved each time, of unknown format. I just want to save to database instead of "_SESSION" ... but is it not possible?
The text was updated successfully, but these errors were encountered: