Skip to content

Commit

Permalink
Generate random data to fill the userid field
Browse files Browse the repository at this point in the history
Since there is no resident key support on the relying party, generating
random data to fill the user.id field.
  • Loading branch information
cpiper committed Aug 26, 2019
1 parent 6e5d6b1 commit a805e9e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public PublicKeyCredentialCreationOptions(String userName, String userId, String
pubKeyCredParams = new ArrayList<PublicKeyCredentialParameters>();
excludeCredentials = new ArrayList<PublicKeyCredentialDescriptor>();
rp = new PublicKeyCredentialRpEntity(rpId, rpName, null);
user = new PublicKeyCredentialUserEntity(userName, userId.getBytes(StandardCharsets.UTF_8));
byte[] userIdBytes = new byte[32];
random.nextBytes(userIdBytes);
user = new PublicKeyCredentialUserEntity(userName, userIdBytes);

challenge = new byte[CHALLENGE_LENGTH];
random.nextBytes(challenge);
Expand Down

0 comments on commit a805e9e

Please sign in to comment.