Class StepUpAuthorizationRequestResolver

java.lang.Object
com.irurueta.authserver.bff.api.web.login.StepUpAuthorizationRequestResolver
All Implemented Interfaces:
org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver

public class StepUpAuthorizationRequestResolver extends Object implements org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver
Adds the step-up values that BffLoginController kept in the session to the authorization request built by the delegate, as the OpenID Connect acr_values and max_age parameters, and forgets them, so they apply to one login only. Without them the authorization request is the delegate's, unchanged.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
    Authorization request parameter naming the authentication context classes asked for.
    private final org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver
    Builds the authorization request.
    (package private) static final String
    Authorization request parameter naming the maximum age of the authentication, in seconds.
    static final String
    Session attribute holding the StepUpLoginParameters of the next login.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest
    resolve(jakarta.servlet.http.HttpServletRequest request)
     
    org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest
    resolve(jakarta.servlet.http.HttpServletRequest request, String clientRegistrationId)
     
    private static org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest
    withStepUp(jakarta.servlet.http.HttpServletRequest request, org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest authorizationRequest)
    Adds the step-up values of the session, if any, to an authorization request and removes them from the session.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • STEP_UP_ATTRIBUTE

      public static final String STEP_UP_ATTRIBUTE
      Session attribute holding the StepUpLoginParameters of the next login.
    • ACR_VALUES_PARAMETER

      static final String ACR_VALUES_PARAMETER
      Authorization request parameter naming the authentication context classes asked for.
      See Also:
    • MAX_AGE_PARAMETER

      static final String MAX_AGE_PARAMETER
      Authorization request parameter naming the maximum age of the authentication, in seconds.
      See Also:
    • delegate

      private final org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver delegate
      Builds the authorization request.
  • Constructor Details

    • StepUpAuthorizationRequestResolver

      public StepUpAuthorizationRequestResolver()
  • 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
    • withStepUp

      private static org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest withStepUp(jakarta.servlet.http.HttpServletRequest request, org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest authorizationRequest)
      Adds the step-up values of the session, if any, to an authorization request and removes them from the session.
      Parameters:
      request - the current request.
      authorizationRequest - the authorization request of the delegate; null when the request is not an authorization request.
      Returns:
      the authorization request with the step-up parameters, or as it was when the session holds none.