File tree Expand file tree Collapse file tree 1 file changed +50
-1
lines changed
webauthn-server-core/src/test/scala/com/yubico/webauthn Expand file tree Collapse file tree 1 file changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -3553,8 +3553,57 @@ class RelyingPartyRegistrationSpec
3553
3553
}
3554
3554
3555
3555
describe(" RelyingParty.finishRegistration" ) {
3556
- it(" throws RegistrationFailedException in case of errors." ) {
3556
+ it(" supports 1023 bytes long credential IDs." ) {
3557
+ val rp = RelyingParty
3558
+ .builder()
3559
+ .identity(
3560
+ RelyingPartyIdentity
3561
+ .builder()
3562
+ .id(" localhost" )
3563
+ .name(" Test party" )
3564
+ .build()
3565
+ )
3566
+ .credentialRepository(Helpers .CredentialRepository .empty)
3567
+ .build()
3557
3568
3569
+ val pkcco = rp.startRegistration(
3570
+ StartRegistrationOptions
3571
+ .builder()
3572
+ .user(
3573
+ UserIdentity
3574
+ .builder()
3575
+ .name(" test" )
3576
+ .displayName(" Test Testsson" )
3577
+ .id(new ByteArray (Array ()))
3578
+ .build()
3579
+ )
3580
+ .build()
3581
+ )
3582
+
3583
+ forAll(byteArray(1023 )) { credId =>
3584
+ val credential = TestAuthenticator
3585
+ .createUnattestedCredential(challenge = pkcco.getChallenge)
3586
+ ._1
3587
+ .toBuilder()
3588
+ .id(credId)
3589
+ .build()
3590
+
3591
+ val result = Try (
3592
+ rp.finishRegistration(
3593
+ FinishRegistrationOptions
3594
+ .builder()
3595
+ .request(pkcco)
3596
+ .response(credential)
3597
+ .build()
3598
+ )
3599
+ )
3600
+ result shouldBe a[Success [_]]
3601
+ result.get.getKeyId.getId should equal(credId)
3602
+ result.get.getKeyId.getId.size should be(1023 )
3603
+ }
3604
+ }
3605
+
3606
+ it(" throws RegistrationFailedException in case of errors." ) {
3558
3607
val rp = RelyingParty
3559
3608
.builder()
3560
3609
.identity(
You can’t perform that action at this time.
0 commit comments