Class StepUpProblemMapper

java.lang.Object
com.irurueta.authserver.bff.api.web.documents.StepUpProblemMapper

@Component public class StepUpProblemMapper extends Object
Maps a step-up request of the resource server onto the extra members of the step-up-required problem, the values the SPA passes back to GET /bff/login. They are values the resource server chose, so they are kept within what that endpoint accepts, otherwise the login would answer 400 and the user could never step up:
  • acrValues: only the references of the accepted format are kept, and none at all when the result would be empty or longer than the login allows;
  • maxAge: capped at the login's maximum, which is stricter than what the resource server asked for, so the new sign-in still satisfies it.
  • Field Details

    • ACR_VALUES_PROPERTY

      static final String ACR_VALUES_PROPERTY
      Problem member carrying the authentication context classes.
      See Also:
    • MAX_AGE_PROPERTY

      static final String MAX_AGE_PROPERTY
      Problem member carrying the maximum age, in seconds.
      See Also:
    • ACR_VALUES_SEPARATOR

      private static final String ACR_VALUES_SEPARATOR
      Separator of the authentication context class references: any run of whitespace.
      See Also:
  • Constructor Details

    • StepUpProblemMapper

      public StepUpProblemMapper()
  • Method Details

    • toProblemProperties

      public Map<String,Object> toProblemProperties(DocumentsStepUpRequiredException exception)
      Builds the extra problem members of a step-up request.
      Parameters:
      exception - the step-up request, with the values the resource server asked for.
      Returns:
      the members, in a stable order; empty when the resource server named no usable value.
    • acceptedAcrValues

      private static String acceptedAcrValues(String acrValues)
      Keeps the authentication context class references of the format the login accepts.
      Parameters:
      acrValues - space-separated references.
      Returns:
      the accepted ones, separated by one space; empty when none is.