Skip to content

Commit 22c362e

Browse files
committed
Add an origins(Optional) setter to RelyingPartyV2
1 parent 71e2793 commit 22c362e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingPartyV2.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,16 @@ public static class RelyingPartyV2Builder<C extends CredentialRecord> {
563563
Optional.empty();
564564
private @NonNull Optional<AttestationTrustSource> attestationTrustSource = Optional.empty();
565565

566+
public RelyingPartyV2Builder<C> origins(@NonNull Set<String> origins) {
567+
this.origins = origins;
568+
return this;
569+
}
570+
571+
public RelyingPartyV2Builder<C> origins(Optional<Set<String>> origins) {
572+
this.origins = origins.orElse(null);
573+
return this;
574+
}
575+
566576
/**
567577
* The extension input to set for the <code>appid</code> and <code>appidExclude</code>
568578
* extensions.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ class RelyingPartyStartOperationSpec
987987
)
988988
)
989989
.preferredPubkeyParams(List(PublicKeyCredentialParameters.ES256).asJava)
990-
.origins(Set.empty.asJava)
990+
.origins(Set.empty[String].asJava)
991991
if (usernameRepository) {
992992
builder.usernameRepository(Helpers.UsernameRepository.withUsers(userId))
993993
}

0 commit comments

Comments
 (0)