@@ -563,11 +563,65 @@ public static class RelyingPartyV2Builder<C extends CredentialRecord> {
563
563
Optional .empty ();
564
564
private @ NonNull Optional <AttestationTrustSource > attestationTrustSource = Optional .empty ();
565
565
566
+ /**
567
+ * The allowed origins that returned authenticator responses will be compared against.
568
+ *
569
+ * <p>The default is the set containing only the string <code>
570
+ * "https://" + {@link #getIdentity()}.getId()</code>.
571
+ *
572
+ * <p>If {@link RelyingPartyV2Builder#allowOriginPort(boolean) allowOriginPort} and {@link
573
+ * RelyingPartyV2Builder#allowOriginSubdomain(boolean) allowOriginSubdomain} are both <code>
574
+ * false</code> (the default), then a successful registration or authentication operation
575
+ * requires {@link CollectedClientData#getOrigin()} to exactly equal one of these values.
576
+ *
577
+ * <p>If {@link RelyingPartyV2Builder#allowOriginPort(boolean) allowOriginPort} is <code>true
578
+ * </code> , then the above rule is relaxed to allow any port number in {@link
579
+ * CollectedClientData#getOrigin()}, regardless of any port specified.
580
+ *
581
+ * <p>If {@link RelyingPartyV2Builder#allowOriginSubdomain(boolean) allowOriginSubdomain} is
582
+ * <code>true</code>, then the above rule is relaxed to allow any subdomain, of any depth, of
583
+ * any of these values.
584
+ *
585
+ * <p>For either of the above relaxations to take effect, both the allowed origin and the client
586
+ * data origin must be valid URLs. Origins that are not valid URLs are matched only by exact
587
+ * string equality.
588
+ *
589
+ * @see #getIdentity()
590
+ * @see #origins(Optional)
591
+ */
566
592
public RelyingPartyV2Builder <C > origins (@ NonNull Set <String > origins ) {
567
593
this .origins = origins ;
568
594
return this ;
569
595
}
570
596
597
+ /**
598
+ * The allowed origins that returned authenticator responses will be compared against.
599
+ *
600
+ * <p>If set to empty, this setting reverts to the default value.
601
+ *
602
+ * <p>The default is the set containing only the string <code>
603
+ * "https://" + {@link #getIdentity()}.getId()</code>.
604
+ *
605
+ * <p>If {@link RelyingPartyV2Builder#allowOriginPort(boolean) allowOriginPort} and {@link
606
+ * RelyingPartyV2Builder#allowOriginSubdomain(boolean) allowOriginSubdomain} are both <code>
607
+ * false</code> (the default), then a successful registration or authentication operation
608
+ * requires {@link CollectedClientData#getOrigin()} to exactly equal one of these values.
609
+ *
610
+ * <p>If {@link RelyingPartyV2Builder#allowOriginPort(boolean) allowOriginPort} is <code>true
611
+ * </code> , then the above rule is relaxed to allow any port number in {@link
612
+ * CollectedClientData#getOrigin()}, regardless of any port specified.
613
+ *
614
+ * <p>If {@link RelyingPartyV2Builder#allowOriginSubdomain(boolean) allowOriginSubdomain} is
615
+ * <code>true</code>, then the above rule is relaxed to allow any subdomain, of any depth, of
616
+ * any of these values.
617
+ *
618
+ * <p>For either of the above relaxations to take effect, both the allowed origin and the client
619
+ * data origin must be valid URLs. Origins that are not valid URLs are matched only by exact
620
+ * string equality.
621
+ *
622
+ * @see #getIdentity()
623
+ * @see #origins(Set)
624
+ */
571
625
public RelyingPartyV2Builder <C > origins (@ NonNull Optional <Set <String >> origins ) {
572
626
this .origins = origins .orElse (null );
573
627
return this ;
0 commit comments