Class TokenSecurityRealm.Builder

java.lang.Object
org.wildfly.security.auth.realm.token.TokenSecurityRealm.Builder
Enclosing class:
TokenSecurityRealm

public static class TokenSecurityRealm.Builder extends Object
  • Method Details

    • principalClaimName

      public TokenSecurityRealm.Builder principalClaimName(String name)
      The name of the claim that should be used to obtain the principal's name.
      Parameters:
      name - the name of the claim that should be used to obtain the principal's name. Defaults to username
      Returns:
      this instance
    • claimToPrincipal

      public TokenSecurityRealm.Builder claimToPrincipal(Function<Attributes,Principal> func)
      A function that maps the set of token claims to a Principal. If not specified, a function that takes the principalClaimName claim value and wraps in in a NamePrincipal is used.
      Parameters:
      func - - the claim set to Principal mapping function.
      Returns:
      the token Principal.
    • validator

      public TokenSecurityRealm.Builder validator(TokenValidator strategy)
      Defines a TokenValidator that will be used to validate tokens.
      Returns:
      this instance
    • build

      public TokenSecurityRealm build()
      Creates a TokenSecurityRealm instance with all the given configuration.
      Returns:
      a new TokenSecurityRealm instance with all the given configuration