Class WebSessionServerOAuth2AuthorizedClientRepository

java.lang.Object
org.springframework.security.oauth2.client.web.server.WebSessionServerOAuth2AuthorizedClientRepository
All Implemented Interfaces:
ServerOAuth2AuthorizedClientRepository

public final class WebSessionServerOAuth2AuthorizedClientRepository extends Object implements ServerOAuth2AuthorizedClientRepository
An implementation of an OAuth2AuthorizedClientRepository that stores OAuth2AuthorizedClient's in the HttpSession.
Since:
5.1
See Also:
  • Constructor Details

    • WebSessionServerOAuth2AuthorizedClientRepository

      public WebSessionServerOAuth2AuthorizedClientRepository()
  • Method Details

    • loadAuthorizedClient

      public <T extends OAuth2AuthorizedClient> reactor.core.publisher.Mono<T> loadAuthorizedClient(String clientRegistrationId, org.springframework.security.core.Authentication principal, org.springframework.web.server.ServerWebExchange exchange)
      Description copied from interface: ServerOAuth2AuthorizedClientRepository
      Returns the OAuth2AuthorizedClient associated to the provided client registration identifier and End-User Authentication (Resource Owner) or null if not available.
      Specified by:
      loadAuthorizedClient in interface ServerOAuth2AuthorizedClientRepository
      Type Parameters:
      T - a type of OAuth2AuthorizedClient
      Parameters:
      clientRegistrationId - the identifier for the client's registration
      principal - the End-User Authentication (Resource Owner)
      exchange - the ServerWebExchange
      Returns:
      the OAuth2AuthorizedClient or null if not available
    • saveAuthorizedClient

      public reactor.core.publisher.Mono<Void> saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, org.springframework.security.core.Authentication principal, org.springframework.web.server.ServerWebExchange exchange)
      Description copied from interface: ServerOAuth2AuthorizedClientRepository
      Saves the OAuth2AuthorizedClient associating it to the provided End-User Authentication (Resource Owner).
      Specified by:
      saveAuthorizedClient in interface ServerOAuth2AuthorizedClientRepository
      Parameters:
      authorizedClient - the authorized client
      principal - the End-User Authentication (Resource Owner)
      exchange - the ServerWebExchange
    • removeAuthorizedClient

      public reactor.core.publisher.Mono<Void> removeAuthorizedClient(String clientRegistrationId, org.springframework.security.core.Authentication principal, org.springframework.web.server.ServerWebExchange exchange)
      Description copied from interface: ServerOAuth2AuthorizedClientRepository
      Removes the OAuth2AuthorizedClient associated to the provided client registration identifier and End-User Authentication (Resource Owner).
      Specified by:
      removeAuthorizedClient in interface ServerOAuth2AuthorizedClientRepository
      Parameters:
      clientRegistrationId - the identifier for the client's registration
      principal - the End-User Authentication (Resource Owner)
      exchange - the ServerWebExchange