Interface AuthenticationBuilder

All Superinterfaces:
Serializable

public interface AuthenticationBuilder extends Serializable
Constructs immutable Authentication objects using the builder pattern.
Since:
4.1.0
  • Method Details

    • getPrincipal

      Principal getPrincipal()
      Gets the authenticated principal.
      Returns:
      Principal. principal
    • setPrincipal

      Sets the principal returns this instance.
      Parameters:
      p - Authenticated principal.
      Returns:
      This builder instance.
    • addCredentials

      AuthenticationBuilder addCredentials(List<Credential> credentials)
      Add credentials authentication builder.
      Parameters:
      credentials - the credentials
      Returns:
      the authentication builder
      Since:
      4.2.0
    • addCredential

      AuthenticationBuilder addCredential(Credential credential)
      Adds metadata about a credential presented for authentication.
      Parameters:
      credential - Credential metadata.
      Returns:
      This builder instance.
    • addWarnings

      Add warnings to authentication builder.
      Parameters:
      warning - the warning
      Returns:
      the authentication builder
    • addWarning

      Add warning to authentication builder.
      Parameters:
      warning - the warning
      Returns:
      the authentication builder
    • setWarnings

      Set warning to authentication builder.
      Parameters:
      warning - the warning
      Returns:
      the authentication builder
    • addAttribute

      AuthenticationBuilder addAttribute(String key, List<Object> value)
      Adds an authentication metadata attribute key-value pair.
      Parameters:
      key - Authentication attribute key.
      value - Authentication attribute value.
      Returns:
      This builder instance.
    • addAttribute

      AuthenticationBuilder addAttribute(String key, Object value)
      Adds an authentication metadata attribute key-value pair.
      Parameters:
      key - Authentication attribute key.
      value - Authentication attribute value.
      Returns:
      This builder instance.
    • addAttributes

      AuthenticationBuilder addAttributes(Map<String,Object> attributes)
      Add attributes.
      Parameters:
      attributes - the attributes
      Returns:
      the authentication builder
    • getSuccesses

      Gets the authentication success map.
      Returns:
      Non -null map of handler names to successful handler authentication results.
    • setSuccesses

      Set successes authentication builder.
      Parameters:
      successes - the successes
      Returns:
      the authentication builder
      Since:
      4.2.0
    • addSuccesses

      Adds successes authentication builder.
      Parameters:
      successes - the successes
      Returns:
      the authentication builder
      Since:
      4.2.0
    • addFailures

      AuthenticationBuilder addFailures(Map<String,Throwable> failures)
      Adds failures.
      Parameters:
      failures - the failures
      Returns:
      the failures
      Since:
      4.2.0
    • addSuccess

      Adds an authentication success to the map of handler names to successful authentication handler results.
      Parameters:
      key - Authentication handler name.
      value - Successful authentication handler result produced by handler of given name.
      Returns:
      This builder instance.
    • build

      Creates an immutable authentication instance from builder data.
      Returns:
      Immutable authentication.
    • getFailures

      Map<String,Throwable> getFailures()
      Gets the authentication failure map.
      Returns:
      Non -null authentication failure map.
    • setFailures

      AuthenticationBuilder setFailures(Map<String,Throwable> failures)
      Sets failures.
      Parameters:
      failures - the failures
      Returns:
      the failures
    • addFailure

      AuthenticationBuilder addFailure(String key, Throwable value)
      Adds an authentication failure to the map of handler names to the authentication handler failures.
      Parameters:
      key - Authentication handler name.
      value - Exception raised on handler failure to authenticate credential.
      Returns:
      This builder instance.
    • setAttributes

      AuthenticationBuilder setAttributes(Map<String,List<Object>> attributes)
      Sets the authentication metadata attributes.
      Parameters:
      attributes - Non-null map of authentication metadata attributes.
      Returns:
      This builder instance.
    • mergeAttributes

      @CanIgnoreReturnValue default AuthenticationBuilder mergeAttributes(Map<String,List<Object>> toMerge)
      Merge attribute.
      Parameters:
      toMerge - the to merge
      Returns:
      the authentication builder
    • mergeAttribute

      AuthenticationBuilder mergeAttribute(String key, Object value)
      Merge attribute.
      Parameters:
      key - the key
      value - the value
      Returns:
      the authentication builder
    • mergeAttribute

      AuthenticationBuilder mergeAttribute(String key, List<Object> value)
      Merge attribute.
      Parameters:
      key - the key
      value - the value
      Returns:
      the authentication builder
    • getAuthenticationDate

      ZonedDateTime getAuthenticationDate()
      Retrieve the authentication date/time as indicated by this builder.
      Returns:
      authn date/time
    • setAuthenticationDate

      AuthenticationBuilder setAuthenticationDate(ZonedDateTime d)
      Sets the authentication date and returns this instance.
      Parameters:
      d - Authentication date.
      Returns:
      This builder instance.
    • hasAttribute

      boolean hasAttribute(String name, Predicate<Object> value)
      Has attribute boolean.
      Parameters:
      name - the name
      value - the value
      Returns:
      true /false
    • hasAttribute

      default boolean hasAttribute(String name)
      Has attribute boolean.
      Parameters:
      name - the name
      Returns:
      true/false