Class JdbcSecurityRealmBuilder
- java.lang.Object
- 
- org.wildfly.security.auth.realm.jdbc.JdbcSecurityRealmBuilder
 
- 
- Direct Known Subclasses:
- QueryBuilder
 
 public class JdbcSecurityRealmBuilder extends Object A builder class to that createsJdbcSecurityRealminstances.- Author:
- Pedro Igor
 
- 
- 
Field SummaryFields Modifier and Type Field Description private CharsethashCharsetprivate Supplier<Provider[]>providersprivate List<QueryBuilder>queries
 - 
Constructor SummaryConstructors Constructor Description JdbcSecurityRealmBuilder()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description JdbcSecurityRealmbuild()Builds a newJdbcSecurityRealminstance based on configuration defined for thisJdbcSecurityRealmBuilderinstance.QueryBuilderprincipalQuery(String sql)A SQL SELECT statement that will be used to return data from a database based on the principal's name.JdbcSecurityRealmBuildersetHashCharset(Charset hashCharset)Set the character set to use when converting the password string to a byte array.JdbcSecurityRealmBuildersetProviders(Supplier<Provider[]> providers)Set the providers to be used by the realm.
 
- 
- 
- 
Field Detail- 
queriesprivate List<QueryBuilder> queries 
 - 
hashCharsetprivate Charset hashCharset 
 
- 
 - 
Method Detail- 
buildpublic JdbcSecurityRealm build() Builds a newJdbcSecurityRealminstance based on configuration defined for thisJdbcSecurityRealmBuilderinstance.- Returns:
- the built realm
 
 - 
setProviderspublic JdbcSecurityRealmBuilder setProviders(Supplier<Provider[]> providers) Set the providers to be used by the realm.- Parameters:
- providers- the providers to be used by the realm.
- Returns:
- this builder.
 
 - 
setHashCharsetpublic JdbcSecurityRealmBuilder setHashCharset(Charset hashCharset) Set the character set to use when converting the password string to a byte array. Uses UTF-8 by default.- Parameters:
- hashCharset- the name of the character set (must not be- null)
- Returns:
- this builder
 
 - 
principalQuerypublic QueryBuilder principalQuery(String sql) A SQL SELECT statement that will be used to return data from a database based on the principal's name. When authenticating, validating or obtaining credentials for a RealmIdentity, this query will be used. You must provide a SELECT with a single query parameter as follows:JdbcSecurityRealm securityRealm = JdbcSecurityRealm.builder().principalQuery("SELECT password FROM user_bcrypt_password where name = ?")Where the query parameter value would be the principal's name. - Parameters:
- sql- the authentication query
- Returns:
- this builder
 
 
- 
 
-