Class BffLoginController

java.lang.Object
com.irurueta.authserver.bff.api.web.login.BffLoginController
All Implemented Interfaces:
LoginApi

@RestController public class BffLoginController extends Object implements LoginApi
Starts the OpenID Connect login, as the contract apis/bff/rest-server/bff-api-v1.yaml describes it through the generated LoginApi.
  • Field Details

    • DEFAULT_RETURN_TO

      static final String DEFAULT_RETURN_TO
      Where the browser goes when the login is requested without returnTo.
      See Also:
    • AUTHORIZATION_PATH

      static final String AUTHORIZATION_PATH
      Authorization request endpoint of the bff registration.
      See Also:
    • returnToValidator

      private final ReturnToValidator returnToValidator
      Decides which returnTo values are safe.
    • request

      private final jakarta.servlet.http.HttpServletRequest request
      The current request, injected as a thread-bound proxy.
  • Constructor Details

    • BffLoginController

      public BffLoginController()
  • Method Details

    • login

      public org.springframework.http.ResponseEntity<Void> login(String returnTo, String acrValues, Long maxAge)
      Validates returnTo, keeps it in the session for ReturnToAuthenticationSuccessHandler, which sends the browser there once the OAuth2 login succeeds, keeps the step-up values (if any) for StepUpAuthorizationRequestResolver, which adds them to the authorization request, and redirects to the authorization request. The format and range of acrValues and maxAge are checked by the generated interface.
      Specified by:
      login in interface LoginApi
      Parameters:
      returnTo - relative path to return to after the login; the root of the application when absent.
      acrValues - authentication context classes to ask the authorization server for; none when absent.
      maxAge - maximum age, in seconds, of the authentication to ask for; none when absent.
      Returns:
      a redirect to the authorization request.
      Throws:
      org.springframework.web.server.ResponseStatusException - answered 400 when returnTo is not an allowed relative path.