public class SimpleAuthenticationConfig extends AbstractClusterLoginConfig<SimpleAuthenticationConfig>
SimplePropertiesLoginModule. The user configuration (username, password, and
assigned roles) is directly part of the configuration object.| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleAuthenticationConfig.UserDto
Helper immutable object representing user attributes (i.e.
|
| Constructor and Description |
|---|
SimpleAuthenticationConfig() |
| Modifier and Type | Method and Description |
|---|---|
SimpleAuthenticationConfig |
addUser(String username,
SimpleAuthenticationConfig.UserDto userDto)
Adds one user to the configuration.
|
SimpleAuthenticationConfig |
addUser(String username,
String password,
String... roles)
Adds one user to the configuration.
|
LoginModuleConfig[] |
asLoginModuleConfigs()
Converts current configuration to stack of login modules.
|
boolean |
equals(Object obj) |
String |
getPassword(String username)
Return the configured password for given username.
|
Set<String> |
getRoles(String username)
Returns role names assigned to the given user.
|
String |
getRoleSeparator()
Returns the custom role separator (when set).
|
Set<String> |
getUsernames()
Returns names of users registered in the configuration.
|
int |
hashCode() |
protected Properties |
initLoginModuleProperties() |
protected static String |
requireNonEmpty(String str,
String message) |
protected SimpleAuthenticationConfig |
self() |
SimpleAuthenticationConfig |
setRoleSeparator(String roleSeparator)
Allows to use a custom role separator in the configuration.
|
SimpleAuthenticationConfig |
setUserMap(Map<String,SimpleAuthenticationConfig.UserDto> map)
Replaces the users with ones from the given map.
|
String |
toString() |
getSkipEndpoint, getSkipIdentity, getSkipRole, setIfConfigured, setIfConfigured, setIfConfigured, setSkipEndpoint, setSkipIdentity, setSkipRolepublic SimpleAuthenticationConfig addUser(@Nonnull String username, @Nonnull String password, String... roles)
username - usernamepassword - user's passwordroles - roles assigned to the userpublic SimpleAuthenticationConfig addUser(@Nonnull String username, @Nonnull SimpleAuthenticationConfig.UserDto userDto)
username - usernameuserDto - user's attributespublic SimpleAuthenticationConfig setRoleSeparator(@Nullable String roleSeparator)
roleSeparator - new separator@Nullable public String getRoleSeparator()
null is returned and default separator is
used ("," - comma).@Nonnull public Set<String> getUsernames()
public String getPassword(@Nonnull String username)
username - usernamepublic Set<String> getRoles(@Nonnull String username)
username - usernamepublic SimpleAuthenticationConfig setUserMap(@Nullable Map<String,SimpleAuthenticationConfig.UserDto> map)
map - map of new usersprotected Properties initLoginModuleProperties()
initLoginModuleProperties in class AbstractClusterLoginConfig<SimpleAuthenticationConfig>public LoginModuleConfig[] asLoginModuleConfigs()
AuthenticationConfigpublic int hashCode()
hashCode in class AbstractClusterLoginConfig<SimpleAuthenticationConfig>public boolean equals(Object obj)
equals in class AbstractClusterLoginConfig<SimpleAuthenticationConfig>protected SimpleAuthenticationConfig self()
self in class AbstractClusterLoginConfig<SimpleAuthenticationConfig>Copyright © 2023 Hazelcast, Inc.. All rights reserved.