Package org.springframework.security.config.annotation.authentication.configurers.provisioning

# Class UserDetailsManagerConfigurer.UserDetailsBuilder

java.lang.Object
org.springframework.security.config.annotation.authentication.configurers.provisioning.UserDetailsManagerConfigurer.UserDetailsBuilder

Enclosing class:
  UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>

public final class UserDetailsManagerConfigurer.UserDetailsBuilder extends Object
Builds the user to be added. At minimum the username, password, and authorities should provided. The remaining attributes have reasonable defaults.

## Method Summary

Modifier and Type
Method
Description
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`accountExpired(boolean accountExpired)`
Defines if the account is expired or not.
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`accountLocked(boolean accountLocked)`
Defines if the account is locked or not.
`C`
`and()`
Returns the `UserDetailsManagerConfigurer` for method chaining (i.e.
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`authorities(String... authorities)`
Populates the authorities.
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`authorities(List<? extends org.springframework.security.core.GrantedAuthority> authorities)`
Populates the authorities.
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`authorities(org.springframework.security.core.GrantedAuthority... authorities)`
Populates the authorities.
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`credentialsExpired(boolean credentialsExpired)`
Defines if the credentials are expired or not.
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`disabled(boolean disabled)`
Defines if the account is disabled or not.
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`password(String password)`
Populates the password.
`UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder`
`roles(String... roles)`
Populates the roles.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### and

public C and()
Returns the `UserDetailsManagerConfigurer` for method chaining (i.e. to add another user)

Returns:
  the `UserDetailsManagerConfigurer` for method chaining

### password

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder password(String password)
Populates the password. This attribute is required.

Parameters:
  `password` - the password. Cannot be null.
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)

### roles

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder roles(String... roles)
Populates the roles. This method is a shortcut for calling `authorities(String...)`, but automatically prefixes each entry with "ROLE_". This means the following: `builder.roles("USER","ADMIN");` is equivalent to `builder.authorities("ROLE_USER","ROLE_ADMIN");`

This attribute is required, but can also be populated with `authorities(String...)`.

Parameters:
  `roles` - the roles for this user (i.e. USER, ADMIN, etc). Cannot be null, contain null values or start with "ROLE_"
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)

### authorities

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder authorities(org.springframework.security.core.GrantedAuthority... authorities)
Populates the authorities. This attribute is required.

Parameters:
  `authorities` - the authorities for this user. Cannot be null, or contain null values
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)
See Also:
  - `roles(String...)`

### authorities

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder authorities(List<? extends org.springframework.security.core.GrantedAuthority> authorities)
Populates the authorities. This attribute is required.

Parameters:
  `authorities` - the authorities for this user. Cannot be null, or contain null values
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)
See Also:
  - `roles(String...)`

### authorities

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder authorities(String... authorities)
Populates the authorities. This attribute is required.

Parameters:
  `authorities` - the authorities for this user (i.e. ROLE_USER, ROLE_ADMIN, etc). Cannot be null, or contain null values
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)
See Also:
  - `roles(String...)`

### accountExpired

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder accountExpired(boolean accountExpired)
Defines if the account is expired or not. Default is false.

Parameters:
  `accountExpired` - true if the account is expired, false otherwise
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)

### accountLocked

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder accountLocked(boolean accountLocked)
Defines if the account is locked or not. Default is false.

Parameters:
  `accountLocked` - true if the account is locked, false otherwise
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)

### credentialsExpired

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder credentialsExpired(boolean credentialsExpired)
Defines if the credentials are expired or not. Default is false.

Parameters:
  `credentialsExpired` - true if the credentials are expired, false otherwise
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)

### disabled

public UserDetailsManagerConfigurer<B,C>.UserDetailsBuilder disabled(boolean disabled)
Defines if the account is disabled or not. Default is false.

Parameters:
  `disabled` - true if the account is disabled, false otherwise
Returns:
  the `UserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B>,C extends UserDetailsManagerConfigurer<B,C>>.UserDetailsBuilder` for method chaining (i.e. to populate additional attributes for this user)