Package org.wildfly.security.auth.server
Class MechanismConfiguration
- java.lang.Object
-
- org.wildfly.security.auth.server.MechanismConfiguration
-
public final class MechanismConfiguration extends Object
A configuration that applies to an authentication mechanism.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMechanismConfiguration.BuilderA builder for authentication mechanism configuration.
-
Field Summary
Fields Modifier and Type Field Description static MechanismConfigurationEMPTYAn empty mechanism configuration..private Function<Principal,Principal>finalRewriterprivate Map<String,MechanismRealmConfiguration>mechanismRealmsprivate Function<Principal,Principal>postRealmRewriterprivate Function<Principal,Principal>preRealmRewriterprivate RealmMapperrealmMapperprivate CredentialSourceserverCredentialSource
-
Constructor Summary
Constructors Constructor Description MechanismConfiguration(Function<Principal,Principal> preRealmRewriter, Function<Principal,Principal> postRealmRewriter, Function<Principal,Principal> finalRewriter, RealmMapper realmMapper, Collection<MechanismRealmConfiguration> mechanismRealms, CredentialSource serverCredentialSource)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MechanismConfiguration.Builderbuilder()Obtain a newMechanismConfiguration.Buildercapable of building aMechanismConfiguration.Function<Principal,Principal>getFinalRewriter()Get the final rewriter for this mechanism realm.MechanismRealmConfigurationgetMechanismRealmConfiguration(String realmName)Get the mechanism realm configuration for the offered realm with the given name.Collection<String>getMechanismRealmNames()Get the collection of mechanism realm names, in order.Function<Principal,Principal>getPostRealmRewriter()Get the post-realm rewriter for this mechanism realm.Function<Principal,Principal>getPreRealmRewriter()Get the pre-realm rewriter for this mechanism realm.RealmMappergetRealmMapper()Get the realm mapper.CredentialSourcegetServerCredentialSource()Get the server credential source.
-
-
-
Field Detail
-
realmMapper
private final RealmMapper realmMapper
-
mechanismRealms
private final Map<String,MechanismRealmConfiguration> mechanismRealms
-
serverCredentialSource
private final CredentialSource serverCredentialSource
-
EMPTY
public static final MechanismConfiguration EMPTY
An empty mechanism configuration..
-
-
Constructor Detail
-
MechanismConfiguration
MechanismConfiguration(Function<Principal,Principal> preRealmRewriter, Function<Principal,Principal> postRealmRewriter, Function<Principal,Principal> finalRewriter, RealmMapper realmMapper, Collection<MechanismRealmConfiguration> mechanismRealms, CredentialSource serverCredentialSource)
-
-
Method Detail
-
getPreRealmRewriter
public Function<Principal,Principal> getPreRealmRewriter()
Get the pre-realm rewriter for this mechanism realm.- Returns:
- the pre-realm rewriter for this mechanism realm, or
nullto use the default
-
getPostRealmRewriter
public Function<Principal,Principal> getPostRealmRewriter()
Get the post-realm rewriter for this mechanism realm.- Returns:
- the post-realm rewriter for this mechanism realm, or
nullto use the default
-
getFinalRewriter
public Function<Principal,Principal> getFinalRewriter()
Get the final rewriter for this mechanism realm.- Returns:
- the final rewriter for this mechanism realm, or
nullto use the default
-
getRealmMapper
public RealmMapper getRealmMapper()
Get the realm mapper.- Returns:
- the realm mapper, or
nullto use the default
-
getMechanismRealmNames
public Collection<String> getMechanismRealmNames()
Get the collection of mechanism realm names, in order. If no realms are configured, the collection will be empty.- Returns:
- the mechanism realm names to offer (may be empty; not
null)
-
getServerCredentialSource
public CredentialSource getServerCredentialSource()
Get the server credential source.- Returns:
- the server credential source
-
getMechanismRealmConfiguration
public MechanismRealmConfiguration getMechanismRealmConfiguration(String realmName)
Get the mechanism realm configuration for the offered realm with the given name. If the realm name is not known,nullis returned. If the realm name is equal to one of the names returned bygetMechanismRealmNames()on this same instance then it is guaranteed thatnullis never returned.- Parameters:
realmName- the realm name- Returns:
- the realm configuration, or
nullif the realm name is unknown
-
builder
public static MechanismConfiguration.Builder builder()
Obtain a newMechanismConfiguration.Buildercapable of building aMechanismConfiguration.- Returns:
- a new
MechanismConfiguration.Buildercapable of building aMechanismConfiguration.
-
-