public class UserDetailsResourceFactoryBean
extends java.lang.Object
implements org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.FactoryBean<java.util.Collection<org.springframework.security.core.userdetails.UserDetails>>
username=password[,enabled|disabled],roles...
The enabled and disabled properties are optional with enabled being the default. For example:
user=password,ROLE_USER
admin=secret,ROLE_USER,ROLE_ADMIN
disabled_user=does_not_matter,disabled,ROLE_USER
| Constructor and Description |
|---|
UserDetailsResourceFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
static UserDetailsResourceFactoryBean |
fromResource(org.springframework.core.io.Resource propertiesResource)
Create a UserDetailsResourceFactoryBean with a Resource that is a Properties file in the
format defined in
UserDetailsResourceFactoryBean. |
static UserDetailsResourceFactoryBean |
fromResourceLocation(java.lang.String resourceLocation)
Create a UserDetailsResourceFactoryBean with the location of a Resource that is a Properties file in the
format defined in
UserDetailsResourceFactoryBean. |
static UserDetailsResourceFactoryBean |
fromString(java.lang.String users)
Creates a UserDetailsResourceFactoryBean with a resource from the provided String
|
java.util.Collection<org.springframework.security.core.userdetails.UserDetails> |
getObject() |
java.lang.Class<?> |
getObjectType() |
void |
setResource(org.springframework.core.io.Resource resource)
Sets a Resource that is a Properties file in the format defined in
UserDetailsResourceFactoryBean. |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
void |
setResourceLocation(java.lang.String resourceLocation)
Sets the location of a Resource that is a Properties file in the format defined in
UserDetailsResourceFactoryBean. |
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAwarepublic java.util.Collection<org.springframework.security.core.userdetails.UserDetails> getObject()
throws java.lang.Exception
getObject in interface org.springframework.beans.factory.FactoryBean<java.util.Collection<org.springframework.security.core.userdetails.UserDetails>>java.lang.Exceptionpublic java.lang.Class<?> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<java.util.Collection<org.springframework.security.core.userdetails.UserDetails>>public void setResourceLocation(java.lang.String resourceLocation)
UserDetailsResourceFactoryBean.resourceLocation - the location of the properties file that contains the users (i.e. "classpath:users.properties")public void setResource(org.springframework.core.io.Resource resource)
UserDetailsResourceFactoryBean.resource - the Resource to usepublic static UserDetailsResourceFactoryBean fromResourceLocation(java.lang.String resourceLocation)
UserDetailsResourceFactoryBean.resourceLocation - the location of the properties file that contains the users (i.e. "classpath:users.properties")public static UserDetailsResourceFactoryBean fromResource(org.springframework.core.io.Resource propertiesResource)
UserDetailsResourceFactoryBean.propertiesResource - the Resource that is a properties file that contains the userspublic static UserDetailsResourceFactoryBean fromString(java.lang.String users)
users - the string representing the users