Package org.wildfly.security.auth.server
Class MechanismConfiguration.Builder
java.lang.Object
org.wildfly.security.auth.server.MechanismConfiguration.Builder
- Enclosing class:
- MechanismConfiguration
A builder for authentication mechanism configuration.
-
Method Summary
Modifier and TypeMethodDescriptionaddMechanismRealm(MechanismRealmConfiguration configuration) Adds a configuration for one of realms of this mechanism.build()Build a new instance.setFinalRewriter(Function<Principal, Principal> finalRewriter) Set a final principal transformer to apply for this mechanism realm.setPostRealmRewriter(Function<Principal, Principal> postRealmRewriter) Set a principal transformer to apply after the realm is selected.setPreRealmRewriter(Function<Principal, Principal> preRealmRewriter) Set a principal transformer to apply before the realm is selected.setRealmMapper(RealmMapper realmMapper) Sets a realm mapper to be used by the mechanism.setServerCredential(Credential credential) Set a single server credential.setServerCredential(SecurityFactory<? extends Credential> credentialFactory) Set a single server credential factory.setServerCredentialSource(CredentialSource serverCredentialSource) Set the server credential source.
-
Method Details
-
setPreRealmRewriter
public MechanismConfiguration.Builder setPreRealmRewriter(Function<Principal, Principal> preRealmRewriter) Set a principal transformer to apply before the realm is selected.- Parameters:
preRealmRewriter- a principal transformer to apply before the realm is selected- Returns:
- this builder
-
setPostRealmRewriter
public MechanismConfiguration.Builder setPostRealmRewriter(Function<Principal, Principal> postRealmRewriter) Set a principal transformer to apply after the realm is selected. Any previously set credential source will be overwritten.- Parameters:
postRealmRewriter- a principal transformer to apply after the realm is selected- Returns:
- this builder
-
setFinalRewriter
Set a final principal transformer to apply for this mechanism realm. Any previously set credential source will be overwritten.- Parameters:
finalRewriter- a final principal transformer to apply for this mechanism realm- Returns:
- this builder
-
setRealmMapper
Sets a realm mapper to be used by the mechanism. Any previously set credential source will be overwritten.- Parameters:
realmMapper- a realm mapper to be used by the mechanism- Returns:
- this builder
-
addMechanismRealm
Adds a configuration for one of realms of this mechanism.- Parameters:
configuration- a configuration for one of realms of this mechanism- Returns:
- this builder
-
setServerCredential
Set a single server credential. Any previously set credential source will be overwritten.- Parameters:
credential- the credential to set (must not benull)- Returns:
- this builder
-
setServerCredential
public MechanismConfiguration.Builder setServerCredential(SecurityFactory<? extends Credential> credentialFactory) Set a single server credential factory. Any previously set credential source will be overwritten.- Parameters:
credentialFactory- the credential factory to set (must not benull)- Returns:
- this builder
-
setServerCredentialSource
public MechanismConfiguration.Builder setServerCredentialSource(CredentialSource serverCredentialSource) Set the server credential source. Any previously set credential source will be overwritten.- Parameters:
serverCredentialSource- the server credential source (must not benull)- Returns:
- this builder
-
build
Build a new instance. If no mechanism realms are offered, an empty collection should be provided formechanismRealms; otherwise, if the mechanism only supports one realm, the first will be used. If the mechanism does not support realms,mechanismRealmsis ignored.- Returns:
- a new instance
-