Package org.springframework.security.authentication

# Class ReactiveAuthenticationManagerAdapter

java.lang.Object
org.springframework.security.authentication.ReactiveAuthenticationManagerAdapter

All Implemented Interfaces:
  `ReactiveAuthenticationManager`

public class ReactiveAuthenticationManagerAdapter extends Object implements ReactiveAuthenticationManager
Adapts an AuthenticationManager to the reactive APIs. This is somewhat necessary because many of the ways that credentials are stored (i.e. JDBC, LDAP, etc) do not have reactive implementations. What's more is it is generally considered best practice to store passwords in a hash that is intentionally slow which would block ever request from coming in unless it was put on another thread.

Since:
  5.0

## Constructor Summary

Constructors
Constructor
Description
`ReactiveAuthenticationManagerAdapter(AuthenticationManager authenticationManager)`

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<Authentication>`
`authenticate(Authentication token)`
Attempts to authenticate the provided `Authentication`
`void`
`setScheduler(reactor.core.scheduler.Scheduler scheduler)`
Set a scheduler that will be published on to perform the authentication logic.

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

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

## Constructor Details

### ReactiveAuthenticationManagerAdapter

public ReactiveAuthenticationManagerAdapter(AuthenticationManager authenticationManager)

## Method Details

### authenticate

public reactor.core.publisher.Mono<Authentication> authenticate(Authentication token)
Description copied from interface: `ReactiveAuthenticationManager`
Attempts to authenticate the provided `Authentication`

Specified by:
  `authenticate` in interface `ReactiveAuthenticationManager`
Parameters:
  `token` - the `Authentication` to test
Returns:
  if authentication is successful an `Authentication` is returned. If authentication cannot be determined, an empty Mono is returned. If authentication fails, a Mono error is returned.

### setScheduler

public void setScheduler(reactor.core.scheduler.Scheduler scheduler)
Set a scheduler that will be published on to perform the authentication logic.

Parameters:
  `scheduler` - a scheduler to be published on
Throws:
  `IllegalArgumentException` - if the scheduler is `null`