Class TokenSecurityRealm.Builder
java.lang.Object
org.wildfly.security.auth.realm.token.TokenSecurityRealm.Builder
- Enclosing class:
- TokenSecurityRealm
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aTokenSecurityRealminstance with all the given configuration.A function that maps the set of token claims to a Principal.principalClaimName(String name) The name of the claim that should be used to obtain the principal's name.Defines aTokenValidatorthat will be used to validate tokens.validator(TokenValidator strategy) Defines aTokenValidatorthat will be used to validate tokens.
-
Method Details
-
principalClaimName
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 tousername- Returns:
- this instance
-
claimToPrincipal
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
Defines aTokenValidatorthat will be used to validate tokens.- Returns:
- this instance
-
principalTransformer
Defines aTokenValidatorthat will be used to validate tokens.- Returns:
- this instance
-
build
Creates aTokenSecurityRealminstance with all the given configuration.- Returns:
- a new
TokenSecurityRealminstance with all the given configuration
-