Class DefaultOAuth2AuthorizedClientRepository

java.lang.Object
com.broadleafcommerce.auth.client.service.DefaultOAuth2AuthorizedClientRepository
All Implemented Interfaces:
org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository

public class DefaultOAuth2AuthorizedClientRepository extends Object implements org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository
An implementation of Spring's OAuth2AuthorizedClientRepository that defers to the OAuth2AuthorizedClientEntityService to execute CRUD and map between the persisted domain and Spring's OAuth2AuthorizedClient.
Author:
Cade Rea (cade-rea)
  • Constructor Details

  • Method Details

    • loadAuthorizedClient

      @Nullable public <T extends org.springframework.security.oauth2.client.OAuth2AuthorizedClient> T loadAuthorizedClient(String clientRegistrationId, org.springframework.security.core.Authentication principal, jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      loadAuthorizedClient in interface org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository
    • saveAuthorizedClient

      public void saveAuthorizedClient(org.springframework.security.oauth2.client.OAuth2AuthorizedClient authorizedClient, org.springframework.security.core.Authentication principal, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Specified by:
      saveAuthorizedClient in interface org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository
      Parameters:
      authorizedClient - the authorized client. NOTE - this may be a vanilla, non-extended OAuth2AuthorizedClient instance if a Spring Security component is newly constructing it for a 'create' case. Thus, we cannot assume it will be a TenantAwareOAuth2AuthorizedClient with the corresponding fields already set.
      principal - the End-User Authentication (Resource Owner)
      request - the HttpServletRequest
      response - the HttpServletResponse
    • removeAuthorizedClient

      public void removeAuthorizedClient(String clientRegistrationId, org.springframework.security.core.Authentication principal, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Specified by:
      removeAuthorizedClient in interface org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository
    • loadClientRegistrationOrThrow

      protected org.springframework.security.oauth2.client.registration.ClientRegistration loadClientRegistrationOrThrow(String clientRegistrationId)
    • getAuthorizedClientEntityService

      protected OAuth2AuthorizedClientEntityService<OAuth2AuthorizedClientEntity> getAuthorizedClientEntityService()
    • getClientRegistrationRepository

      protected org.springframework.security.oauth2.client.registration.ClientRegistrationRepository getClientRegistrationRepository()
    • getContextHelperService

      protected ContextHelperService getContextHelperService()