Package org.wildfly.security.auth.server
Interface RealmMapper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A realm mapper. Examines authentication identity information and translates it into a realm name. If the realm
mapper does not recognize the authentication information, a default realm will be chosen.
- Author:
- David M. Lloyd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RealmMapperA realm mapper which always falls back to a default realm. -
Method Summary
Modifier and TypeMethodDescriptionstatic RealmMapperaggregate(RealmMapper... mappers) Create an aggregate realm mapping strategy.static RealmMapperaggregate(RealmMapper mapper1, RealmMapper mapper2) Create an aggregate realm mapping strategy.getRealmMapping(Principal principal, Evidence evidence) Get the realm mapping.static RealmMappermatching(BiPredicate<? super Principal, ? super Evidence> matchRule, String realmName) Create a realm mapper that matches when the given predicate matches.static RealmMappermatchingEvidence(Predicate<? super Evidence> matchRule, String realmName) Create a realm mapper that matches when the given predicate matches the evidence.static RealmMappermatchingEvidenceType(Class<? extends Evidence> evidenceType, String realmName) Create a realm mapper that matches when the evidence is of the given type.static RealmMappermatchingPrincipal(Predicate<? super Principal> matchRule, String realmName) Create a realm mapper that matches when the given predicate matches the principal.static RealmMappermatchingPrincipalType(Class<? extends Principal> principalType, String realmName) Create a realm mapper that matches when the principal is of the given type.static RealmMapperCreate a realm mapper that always maps to the given realm.
-
Field Details
-
DEFAULT_REALM_MAPPER
A realm mapper which always falls back to a default realm.
-
-
Method Details
-
getRealmMapping
Get the realm mapping. Returnnullif the default realm should be used.- Parameters:
principal- the authentication principal (ornullif none is known for this authentication)evidence- the authentication evidence (ornullif none is known for this authentication)- Returns:
- the realm, or
nullif no particular realm matches the authentication information
-
single
Create a realm mapper that always maps to the given realm.- Parameters:
realmName- the realm name to return, ornullif the default realm should be used- Returns:
- the realm mapper returning
realmName
-
matching
static RealmMapper matching(BiPredicate<? super Principal, ? super Evidence> matchRule, String realmName) Create a realm mapper that matches when the given predicate matches.- Parameters:
matchRule- the match rule (must not benull)realmName- the realm name to return, ornullto return the default realm- Returns:
- the realm mapper (not
null)
-
matchingPrincipal
Create a realm mapper that matches when the given predicate matches the principal.- Parameters:
matchRule- the match rule (must not benull)realmName- the realm name to return, ornullto return the default realm- Returns:
- the realm mapper (not
null)
-
matchingPrincipalType
static RealmMapper matchingPrincipalType(Class<? extends Principal> principalType, String realmName) Create a realm mapper that matches when the principal is of the given type.- Parameters:
principalType- the principal type class (must not benull)realmName- the realm name to return, ornullto return the default realm- Returns:
- the realm mapper (not
null)
-
matchingEvidence
Create a realm mapper that matches when the given predicate matches the evidence.- Parameters:
matchRule- the match rule (must not benull)realmName- the realm name to return, ornullto return the default realm- Returns:
- the realm mapper (not
null)
-
matchingEvidenceType
Create a realm mapper that matches when the evidence is of the given type.- Parameters:
evidenceType- the evidence type class (must not benull)realmName- the realm name to return, ornullto return the default realm- Returns:
- the realm mapper (not
null)
-
aggregate
Create an aggregate realm mapping strategy.- Parameters:
mapper1- the first mapper to try (must not benull)mapper2- the second mapper to try (must not benull)- Returns:
- an aggregated mapper (not
null)
-
aggregate
Create an aggregate realm mapping strategy.- Parameters:
mappers- the mappers to try (must not benull)- Returns:
- an aggregated mapper (not
null)
-