Package org.wildfly.security.auth.util
Class MappedRegexRealmMapper
- java.lang.Object
-
- org.wildfly.security.auth.util.SimpleRegexRealmMapper
-
- org.wildfly.security.auth.util.MappedRegexRealmMapper
-
- All Implemented Interfaces:
RealmMapper
public class MappedRegexRealmMapper extends SimpleRegexRealmMapper
A simple mapping regular expression-based realm mapper. The pattern is used to find the realm portion of the user name. Then, a map is consulted to map this realm portion to an actual configured realm name.- Author:
- David M. Lloyd
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.auth.server.RealmMapper
DEFAULT_REALM_MAPPER
-
-
Constructor Summary
Constructors Constructor Description MappedRegexRealmMapper(Pattern realmNamePattern, Map<String,String> realmNameMap)
Construct a new instance.MappedRegexRealmMapper(Pattern realmNamePattern, RealmMapper delegate, Map<String,String> realmNameMap)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getRealmMapping(Principal principal, Evidence evidence)
Get the realm mapping.
-
-
-
Constructor Detail
-
MappedRegexRealmMapper
public MappedRegexRealmMapper(Pattern realmNamePattern, Map<String,String> realmNameMap)
Construct a new instance.- Parameters:
realmNamePattern
- the realm name pattern, which must contain at least one capture group (cannot benull
)realmNameMap
- the realm portion to realm name map (cannot benull
)
-
MappedRegexRealmMapper
public MappedRegexRealmMapper(Pattern realmNamePattern, RealmMapper delegate, Map<String,String> realmNameMap)
Construct a new instance.- Parameters:
realmNamePattern
- the realm name pattern, which must contain at least one capture group (cannot benull
)delegate
- the delegate mapper to use if the pattern is not matched (cannot benull
)realmNameMap
- the realm portion to realm name map (cannot benull
)
-
-
Method Detail
-
getRealmMapping
public String getRealmMapping(Principal principal, Evidence evidence)
Description copied from interface:RealmMapper
Get the realm mapping. Returnnull
if the default realm should be used.- Specified by:
getRealmMapping
in interfaceRealmMapper
- Overrides:
getRealmMapping
in classSimpleRegexRealmMapper
- Parameters:
principal
- the authentication principal (ornull
if none is known for this authentication)evidence
- the authentication evidence (ornull
if none is known for this authentication)- Returns:
- the realm, or
null
if no particular realm matches the authentication information
-
-