Package org.springframework.security.core.userdetails

# Class MapReactiveUserDetailsService

java.lang.Object
org.springframework.security.core.userdetails.MapReactiveUserDetailsService

All Implemented Interfaces:
  `ReactiveUserDetailsPasswordService`, `ReactiveUserDetailsService`

public class MapReactiveUserDetailsService extends Object implements ReactiveUserDetailsService, ReactiveUserDetailsPasswordService
A `Map` based implementation of `ReactiveUserDetailsService`

Since:
  5.0

## Constructor Summary

Constructors
Constructor
Description
`MapReactiveUserDetailsService(Collection<UserDetails> users)`
Creates a new instance
`MapReactiveUserDetailsService(Map<String,UserDetails> users)`
Creates a new instance using a `Map` that must be non blocking.
`MapReactiveUserDetailsService(UserDetails... users)`
Creates a new instance

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<UserDetails>`
`findByUsername(String username)`
Find the `UserDetails` by username.
`reactor.core.publisher.Mono<UserDetails>`
`updatePassword(UserDetails user, String newPassword)`
Modify the specified user's password.

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

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

## Constructor Details

### MapReactiveUserDetailsService

public MapReactiveUserDetailsService(Map<String,UserDetails> users)
Creates a new instance using a `Map` that must be non blocking.

Parameters:
  `users` - a `Map` of users to use.

### MapReactiveUserDetailsService

public MapReactiveUserDetailsService(UserDetails... users)
Creates a new instance

Parameters:
  `users` - the `UserDetails` to use

### MapReactiveUserDetailsService

public MapReactiveUserDetailsService(Collection<UserDetails> users)
Creates a new instance

Parameters:
  `users` - the `UserDetails` to use

## Method Details

### findByUsername

public reactor.core.publisher.Mono<UserDetails> findByUsername(String username)
Description copied from interface: `ReactiveUserDetailsService`
Find the `UserDetails` by username.

Specified by:
  `findByUsername` in interface `ReactiveUserDetailsService`
Parameters:
  `username` - the username to look up
Returns:
  the `UserDetails`. Cannot be null

### updatePassword

public reactor.core.publisher.Mono<UserDetails> updatePassword(UserDetails user, String newPassword)
Description copied from interface: `ReactiveUserDetailsPasswordService`
Modify the specified user's password. This should change the user's password in the persistent user repository (database, LDAP etc).

Specified by:
  `updatePassword` in interface `ReactiveUserDetailsPasswordService`
Parameters:
  `user` - the user to modify the password for
  `newPassword` - the password to change to
Returns:
  the updated UserDetails with the new password