Skip to content

Commit 09b7b2d

Browse files
committed
Add test of authenticatorSelection parameter
1 parent 0c522a7 commit 09b7b2d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

webauthn-server-core/src/test/scala/com/yubico/webauthn/RelyingPartyStartOperationSpec.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,20 @@ class RelyingPartyStartOperationSpec extends FunSpec with Matchers with Generato
107107
request2.getChallenge.size should be >= 32
108108
}
109109

110+
it("allows setting authenticatorSelection.") {
111+
val authnrSel = AuthenticatorSelectionCriteria.builder()
112+
.authenticatorAttachment(AuthenticatorAttachment.CROSS_PLATFORM)
113+
.requireResidentKey(true)
114+
.build()
115+
116+
val pkcco = relyingParty().startRegistration(
117+
StartRegistrationOptions.builder()
118+
.user(userId)
119+
.authenticatorSelection(authnrSel)
120+
.build())
121+
pkcco.getAuthenticatorSelection.asScala should equal (Some(authnrSel))
122+
}
123+
110124
it("allows setting the timeout to empty.") {
111125
val pkcco = relyingParty().startRegistration(
112126
StartRegistrationOptions.builder()

0 commit comments

Comments
 (0)