Class InMemoryReactiveOAuth2AuthorizedClientService
java.lang.Object
org.springframework.security.oauth2.client.InMemoryReactiveOAuth2AuthorizedClientService
- All Implemented Interfaces:
ReactiveOAuth2AuthorizedClientService
public final class InMemoryReactiveOAuth2AuthorizedClientService
extends Object
implements ReactiveOAuth2AuthorizedClientService
An
OAuth2AuthorizedClientService
that stores Authorized Client(s)
in-memory.- Since:
- 5.1
- See Also:
-
Constructor Summary
ConstructorDescriptionInMemoryReactiveOAuth2AuthorizedClientService
(ReactiveClientRegistrationRepository clientRegistrationRepository) Constructs anInMemoryReactiveOAuth2AuthorizedClientService
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescription<T extends OAuth2AuthorizedClient>
reactor.core.publisher.Mono<T>loadAuthorizedClient
(String clientRegistrationId, String principalName) Returns theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-User'sPrincipal
name ornull
if not available.reactor.core.publisher.Mono<Void>
removeAuthorizedClient
(String clientRegistrationId, String principalName) Removes theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-User'sPrincipal
name.reactor.core.publisher.Mono<Void>
saveAuthorizedClient
(OAuth2AuthorizedClient authorizedClient, Authentication principal) Saves theOAuth2AuthorizedClient
associating it to the provided End-UserAuthentication
(Resource Owner).
-
Constructor Details
-
InMemoryReactiveOAuth2AuthorizedClientService
public InMemoryReactiveOAuth2AuthorizedClientService(ReactiveClientRegistrationRepository clientRegistrationRepository) Constructs anInMemoryReactiveOAuth2AuthorizedClientService
using the provided parameters.- Parameters:
clientRegistrationRepository
- the repository of client registrations
-
-
Method Details
-
loadAuthorizedClient
public <T extends OAuth2AuthorizedClient> reactor.core.publisher.Mono<T> loadAuthorizedClient(String clientRegistrationId, String principalName) Description copied from interface:ReactiveOAuth2AuthorizedClientService
Returns theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-User'sPrincipal
name ornull
if not available.- Specified by:
loadAuthorizedClient
in interfaceReactiveOAuth2AuthorizedClientService
- Type Parameters:
T
- a type of OAuth2AuthorizedClient- Parameters:
clientRegistrationId
- the identifier for the client's registrationprincipalName
- the name of the End-UserPrincipal
(Resource Owner)- Returns:
- the
OAuth2AuthorizedClient
ornull
if not available
-
saveAuthorizedClient
public reactor.core.publisher.Mono<Void> saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal) Description copied from interface:ReactiveOAuth2AuthorizedClientService
Saves theOAuth2AuthorizedClient
associating it to the provided End-UserAuthentication
(Resource Owner).- Specified by:
saveAuthorizedClient
in interfaceReactiveOAuth2AuthorizedClientService
- Parameters:
authorizedClient
- the authorized clientprincipal
- the End-UserAuthentication
(Resource Owner)
-
removeAuthorizedClient
public reactor.core.publisher.Mono<Void> removeAuthorizedClient(String clientRegistrationId, String principalName) Description copied from interface:ReactiveOAuth2AuthorizedClientService
Removes theOAuth2AuthorizedClient
associated to the provided client registration identifier and End-User'sPrincipal
name.- Specified by:
removeAuthorizedClient
in interfaceReactiveOAuth2AuthorizedClientService
- Parameters:
clientRegistrationId
- the identifier for the client's registrationprincipalName
- the name of the End-UserPrincipal
(Resource Owner)
-