Class LdapSecurityRealmBuilder
- java.lang.Object
-
- org.wildfly.security.auth.realm.ldap.LdapSecurityRealmBuilder
-
public class LdapSecurityRealmBuilder extends Object
Builder for the security realm implementation backed by LDAP.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
LdapSecurityRealmBuilder.IdentityMappingBuilder
A builder for a principal mapping.class
LdapSecurityRealmBuilder.OtpCredentialLoaderBuilder
class
LdapSecurityRealmBuilder.UserPasswordCredentialLoaderBuilder
class
LdapSecurityRealmBuilder.X509EvidenceVerifierBuilder
-
Field Summary
Fields Modifier and Type Field Description private boolean
built
private List<CredentialLoader>
credentialLoaders
private List<CredentialPersister>
credentialPersisters
private static int
DEFAULT_SEARCH_TIME_LIMIT
private org.wildfly.common.function.ExceptionSupplier<DirContext,NamingException>
dirContextSupplier
private List<EvidenceVerifier>
evidenceVerifiers
private Charset
hashCharset
private Encoding
hashEncoding
private LdapSecurityRealm.IdentityMapping
identityMapping
private NameRewriter
nameRewriter
private int
pageSize
private Supplier<Provider[]>
providers
-
Constructor Summary
Constructors Modifier Constructor Description private
LdapSecurityRealmBuilder()
-
Method Summary
-
-
-
Field Detail
-
DEFAULT_SEARCH_TIME_LIMIT
private static final int DEFAULT_SEARCH_TIME_LIMIT
- See Also:
- Constant Field Values
-
built
private boolean built
-
dirContextSupplier
private org.wildfly.common.function.ExceptionSupplier<DirContext,NamingException> dirContextSupplier
-
nameRewriter
private NameRewriter nameRewriter
-
identityMapping
private LdapSecurityRealm.IdentityMapping identityMapping
-
pageSize
private int pageSize
-
credentialLoaders
private List<CredentialLoader> credentialLoaders
-
credentialPersisters
private List<CredentialPersister> credentialPersisters
-
evidenceVerifiers
private List<EvidenceVerifier> evidenceVerifiers
-
hashCharset
private Charset hashCharset
-
hashEncoding
private Encoding hashEncoding
-
-
Method Detail
-
builder
public static LdapSecurityRealmBuilder builder()
Construct a new instance.- Returns:
- the new builder instance
-
setProviders
public LdapSecurityRealmBuilder setProviders(Supplier<Provider[]> providers)
The the Provider[] supplier.- Parameters:
providers
- the supplier of Providers to be used by the realm- Returns:
- this builder
-
setDirContextSupplier
public LdapSecurityRealmBuilder setDirContextSupplier(org.wildfly.common.function.ExceptionSupplier<DirContext,NamingException> dirContextSupplier)
Set the directory context supplier.- Parameters:
dirContextSupplier
- the directory context supplier- Returns:
- this builder
-
setNameRewriter
public LdapSecurityRealmBuilder setNameRewriter(NameRewriter nameRewriter)
Add a name rewriter to this builder.- Parameters:
nameRewriter
- the name rewriter- Returns:
- this builder
-
setPageSize
public LdapSecurityRealmBuilder setPageSize(int pageSize)
Set size of page for realm iterating- Parameters:
pageSize
- size of page- Returns:
- this builder
-
identityMapping
public LdapSecurityRealmBuilder.IdentityMappingBuilder identityMapping()
-
setIdentityMapping
LdapSecurityRealmBuilder setIdentityMapping(LdapSecurityRealm.IdentityMapping principalMapping)
Add a principal mapping to this builder.- Returns:
- the builder for the principal mapping
-
setHashCharset
public LdapSecurityRealmBuilder setHashCharset(Charset hashCharset)
Set the character set to use when converting the password string to a byte array. Set to UTF-8 by default.- Parameters:
hashCharset
- the name of the character set (must not benull
).- Returns:
- this builder
-
setHashEncoding
public LdapSecurityRealmBuilder setHashEncoding(Encoding hashEncoding)
Set the string format for the password in the properties file if they are not stored in plain text. Set to base64 by default.- Parameters:
hashEncoding
- specifies the string format for the hashed password- Returns:
- this builder
-
userPasswordCredentialLoader
public LdapSecurityRealmBuilder.UserPasswordCredentialLoaderBuilder userPasswordCredentialLoader()
-
otpCredentialLoader
public LdapSecurityRealmBuilder.OtpCredentialLoaderBuilder otpCredentialLoader()
-
x509EvidenceVerifier
public LdapSecurityRealmBuilder.X509EvidenceVerifierBuilder x509EvidenceVerifier()
-
addCredentialLoader
LdapSecurityRealmBuilder addCredentialLoader(CredentialLoader credentialLoader)
-
addCredentialPersister
LdapSecurityRealmBuilder addCredentialPersister(CredentialPersister credentialPersister)
-
addEvidenceVerifier
LdapSecurityRealmBuilder addEvidenceVerifier(EvidenceVerifier evidenceVerifier)
-
addDirectEvidenceVerification
public LdapSecurityRealmBuilder addDirectEvidenceVerification()
-
addDirectEvidenceVerification
public LdapSecurityRealmBuilder addDirectEvidenceVerification(boolean allowBlankPassword)
-
build
public ModifiableSecurityRealm build()
Build this realm.- Returns:
- the built realm
-
assertNotBuilt
private void assertNotBuilt()
-
-