Class SpringAddonsOAuth2AuthorizationRequestResolver

java.lang.Object
com.c4_soft.springaddons.security.oidc.starter.synchronised.client.SpringAddonsOAuth2AuthorizationRequestResolver
All Implemented Interfaces:
org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver

public class SpringAddonsOAuth2AuthorizationRequestResolver extends Object implements org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver
Support three features: The post-login URIs are used by the default AuthenticationSuccessHandler and AuthenticationFailureHandler

When needing fancy request customizers (for instance to add parameters with name or value computed at runtime), you may extend this class and override getOAuth2AuthorizationRequestCustomizer(HttpServletRequest, String)

Author:
Jerome Wacongne ch4mp@c4-soft.com
See Also:
  • Constructor Details

    • SpringAddonsOAuth2AuthorizationRequestResolver

      public SpringAddonsOAuth2AuthorizationRequestResolver(org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties bootClientProperties, org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository, SpringAddonsOidcClientProperties addonsClientProperties)
  • Method Details

    • resolve

      public org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest resolve(jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      resolve in interface org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver
    • resolve

      public org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest resolve(jakarta.servlet.http.HttpServletRequest request, String clientRegistrationId)
      Specified by:
      resolve in interface org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver
    • getRequestResolver

      protected org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver getRequestResolver(jakarta.servlet.http.HttpServletRequest request, String clientRegistrationId)
      You probably don't need to override this. See getOAuth2AuthorizationRequestCustomizer to add advanced request customizer(s)
      Parameters:
      request -
      clientRegistrationId -
      Returns:
    • getOAuth2AuthorizationRequestCustomizer

      protected Consumer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest.Builder> getOAuth2AuthorizationRequestCustomizer(jakarta.servlet.http.HttpServletRequest request, String clientRegistrationId)
      Override this to use a "dynamic" request customizer. Something like:
       return new CompositeOAuth2AuthorizationRequestCustomizer(getCompositeOAuth2AuthorizationRequestCustomizer(clientRegistrationId), new MyDynamicCustomizer(request), ...);
       
      Returns:
    • getCompositeOAuth2AuthorizationRequestCustomizer

      protected CompositeOAuth2AuthorizationRequestCustomizer getCompositeOAuth2AuthorizationRequestCustomizer(String clientRegistrationId)
      Returns:
      a request customizer adding PKCE token (if activated) and "static" parameters defined in spring-addons properties