public final class InMemoryOAuth2AuthorizedClientService extends java.lang.Object implements OAuth2AuthorizedClientService
OAuth2AuthorizedClientService that stores
Authorized Client(s) in-memory.OAuth2AuthorizedClientService,
OAuth2AuthorizedClient,
OAuth2AuthorizedClientId,
ClientRegistration,
Authentication| Constructor and Description |
|---|
InMemoryOAuth2AuthorizedClientService(ClientRegistrationRepository clientRegistrationRepository)
Constructs an
InMemoryOAuth2AuthorizedClientService using the provided parameters. |
InMemoryOAuth2AuthorizedClientService(ClientRegistrationRepository clientRegistrationRepository,
java.util.Map<OAuth2AuthorizedClientId,OAuth2AuthorizedClient> authorizedClients)
Constructs an
InMemoryOAuth2AuthorizedClientService using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
<T extends OAuth2AuthorizedClient> |
loadAuthorizedClient(java.lang.String clientRegistrationId,
java.lang.String principalName)
Returns the
OAuth2AuthorizedClient associated to the
provided client registration identifier and End-User's Principal name
or null if not available. |
void |
removeAuthorizedClient(java.lang.String clientRegistrationId,
java.lang.String principalName)
Removes the
OAuth2AuthorizedClient associated to the
provided client registration identifier and End-User's Principal name. |
void |
saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient,
org.springframework.security.core.Authentication principal)
Saves the
OAuth2AuthorizedClient associating it to
the provided End-User Authentication (Resource Owner). |
public InMemoryOAuth2AuthorizedClientService(ClientRegistrationRepository clientRegistrationRepository)
InMemoryOAuth2AuthorizedClientService using the provided parameters.clientRegistrationRepository - the repository of client registrationspublic InMemoryOAuth2AuthorizedClientService(ClientRegistrationRepository clientRegistrationRepository, java.util.Map<OAuth2AuthorizedClientId,OAuth2AuthorizedClient> authorizedClients)
InMemoryOAuth2AuthorizedClientService using the provided parameters.clientRegistrationRepository - the repository of client registrationsauthorizedClients - the initial Map of authorized client(s) keyed by OAuth2AuthorizedClientIdpublic <T extends OAuth2AuthorizedClient> T loadAuthorizedClient(java.lang.String clientRegistrationId, java.lang.String principalName)
OAuth2AuthorizedClientServiceOAuth2AuthorizedClient associated to the
provided client registration identifier and End-User's Principal name
or null if not available.loadAuthorizedClient in interface OAuth2AuthorizedClientServiceT - a type of OAuth2AuthorizedClientclientRegistrationId - the identifier for the client's registrationprincipalName - the name of the End-User Principal (Resource Owner)OAuth2AuthorizedClient or null if not availablepublic void saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, org.springframework.security.core.Authentication principal)
OAuth2AuthorizedClientServiceOAuth2AuthorizedClient associating it to
the provided End-User Authentication (Resource Owner).saveAuthorizedClient in interface OAuth2AuthorizedClientServiceauthorizedClient - the authorized clientprincipal - the End-User Authentication (Resource Owner)public void removeAuthorizedClient(java.lang.String clientRegistrationId,
java.lang.String principalName)
OAuth2AuthorizedClientServiceOAuth2AuthorizedClient associated to the
provided client registration identifier and End-User's Principal name.removeAuthorizedClient in interface OAuth2AuthorizedClientServiceclientRegistrationId - the identifier for the client's registrationprincipalName - the name of the End-User Principal (Resource Owner)