Class ServerProperty.Builder

java.lang.Object
com.webauthn4j.server.ServerProperty.Builder
Enclosing class:
ServerProperty

public static class ServerProperty.Builder extends Object
  • Method Details

    • origin

      public ServerProperty.Builder origin(@NotNull @NotNull Origin value)
      Sets an originPredicate that accepts the specified origin. For complicated conditions, use originPredicate(OriginPredicate) instead.
      Parameters:
      value - the expected origin
      Returns:
      the builder instance for method chaining
    • origins

      public ServerProperty.Builder origins(@NotNull @NotNull Set<Origin> value)
      Sets an originPredicate that accepts the specified origins. For complicated conditions, use originPredicate(OriginPredicate) instead.
      Parameters:
      value - the expected origin
      Returns:
      the builder instance for method chaining
    • originPredicate

      public ServerProperty.Builder originPredicate(@NotNull @NotNull OriginPredicate value)
      Sets a predicate to verify the origin. This allows for complex origin validation logic beyond simple equality or set membership checks.
      Parameters:
      value - the predicate used to validate origins
      Returns:
      the builder instance for method chaining
    • rpId

      public ServerProperty.Builder rpId(String value)
      Sets the expected Relying Party ID.
      Parameters:
      value - the rpId value
      Returns:
      the builder instance for method chaining
    • challenge

      public ServerProperty.Builder challenge(Challenge value)
      Sets the expected challenge
      Parameters:
      value - the challenge value
      Returns:
      the builder instance for method chaining
    • topOrigin

      public ServerProperty.Builder topOrigin(@Nullable @Nullable Origin value)
      Sets a topOriginPredicate that accepts the specified topOrigin. For complicated conditions, use topOriginPredicate(OriginPredicate) instead.
      Parameters:
      value - the expected topOrigin
      Returns:
      the builder instance for method chaining
    • topOrigins

      public ServerProperty.Builder topOrigins(@Nullable @Nullable Set<Origin> value)
      Sets a topOriginPredicate that accepts the specified topOrigins. For complicated conditions, use topOriginPredicate(OriginPredicate) instead.
      Parameters:
      value - the expected topOrigin
      Returns:
      the builder instance for method chaining
    • anyTopOrigin

      public ServerProperty.Builder anyTopOrigin()
      Sets a topOriginPredicate that accepts any topOrigins. This allows WebAuthn operations in any iframe scenario regardless of the top origin.
      Returns:
      the builder instance for method chaining
    • topOriginPredicate

      public ServerProperty.Builder topOriginPredicate(OriginPredicate value)
      Sets a predicate to verify the topOrigin. This allows verification of the top origin in iframe scenarios. If not called or null is passed, cross-origin requests in an iframe will not be allowed.
      Parameters:
      value - the predicate used to verify top origin. If null, cross-origin requests will not be allowed.
      Returns:
      the builder instance for method chaining
    • build

      public ServerProperty build()