Package org.wildfly.security.auth.realm
Class LegacyPropertiesSecurityRealm.Builder
java.lang.Object
org.wildfly.security.auth.realm.LegacyPropertiesSecurityRealm.Builder
- Enclosing class:
- LegacyPropertiesSecurityRealm
A builder for legacy properties security realms.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theLegacyPropertiesSecurityRealm.setDefaultRealm(String defaultRealm) Set the default realm name to use if no realm name is discovered in the properties file.setGroupsAttribute(String groupsAttribute) Where this realm returns anAuthorizationIdentityset the key on the Attributes that will be used to hold the group membership information.setGroupsStream(InputStream groupsStream) Set theInputStreamto use to load the group information.setHashCharset(Charset hashCharset) Set the character set to use when converting the password string to a byte array.setHashEncoding(Encoding hashEncoding) Set the string format for the password in the properties file if they are not stored in plain text.setPlainText(boolean plainText) Set format of users property file - if the passwords are stored in plain text.setProviders(Supplier<Provider[]> providers) Set the supplier forProviderinstanced for use bu the realm.setUsersStream(InputStream usersStream) Set theInputStreamto use to load the users.
-
Method Details
-
setProviders
Set the supplier forProviderinstanced for use bu the realm.- Parameters:
providers- the supplier forProviderinstanced for use bu the realm.- Returns:
- this
LegacyPropertiesSecurityRealm.Builder
-
setUsersStream
Set theInputStreamto use to load the users.- Parameters:
usersStream- theInputStreamto use to load the users.- Returns:
- this
LegacyPropertiesSecurityRealm.Builder
-
setGroupsStream
Set theInputStreamto use to load the group information.- Parameters:
groupsStream- theInputStreamto use to load the group information.- Returns:
- this
LegacyPropertiesSecurityRealm.Builder
-
setGroupsAttribute
Where this realm returns anAuthorizationIdentityset the key on the Attributes that will be used to hold the group membership information.- Parameters:
groupsAttribute- the key on the Attributes that will be used to hold the group membership information.- Returns:
- this
LegacyPropertiesSecurityRealm.Builder
-
setDefaultRealm
Set the default realm name to use if no realm name is discovered in the properties file.- Parameters:
defaultRealm- the default realm name if one is not discovered in the properties file.- Returns:
- this
LegacyPropertiesSecurityRealm.Builder
-
setPlainText
Set format of users property file - if the passwords are stored in plain text. Otherwise is HEX( MD5( username ":" realm ":" password ) ) expected.- Parameters:
plainText- if the passwords are stored in plain text.- Returns:
- this
LegacyPropertiesSecurityRealm.Builder
-
setHashEncoding
Set the string format for the password in the properties file if they are not stored in plain text. Set to hex by default.- Parameters:
hashEncoding- specifies the string format for the hashed password- Returns:
- this
LegacyPropertiesSecurityRealm.Builder
-
setHashCharset
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
LegacyPropertiesSecurityRealm.Builder
-
build
Builds theLegacyPropertiesSecurityRealm.- Returns:
- built
LegacyPropertiesSecurityRealm - Throws:
IOException- when loading of property files failsFileNotFoundException- when property file does not existRealmUnavailableException- when property file of users does not contain realm name specification
-