Class LoginController

java.lang.Object
org.cxbox.core.controller.LoginController

@RestController @RequestMapping("#{\'${cxbox.api.path}\'}") public class LoginController extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String role, org.cxbox.api.util.tz.TimeZoneSpecification timezone, org.cxbox.api.util.locale.LocaleSpecification locale)
    Authenticate user in the application; actual authentication performed by Spring Security in client app
    protected Locale
    getLocale(org.springframework.context.i18n.LocaleContext context, org.cxbox.api.util.locale.LocaleSpecification locale)
     
    protected TimeZone
    getTimezone(org.springframework.context.i18n.LocaleContext context, org.cxbox.api.util.tz.TimeZoneSpecification timezone)
     
    Logout endpoint, actual session is usually cleared by client application by specifying this endpoint as `logoutUrl` of Spring Security configuration
    protected void
    resetLocaleContext(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.cxbox.api.util.tz.TimeZoneSpecification timezone, org.cxbox.api.util.locale.LocaleSpecification locale)
     

    Methods inherited from class java.lang.Object

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

    • LoginController

      public LoginController()
  • Method Details

    • get

      @RequestMapping(method=GET, value="/login") public LoggedUser get(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @RequestParam(name="role",required=false) String role, org.cxbox.api.util.tz.TimeZoneSpecification timezone, org.cxbox.api.util.locale.LocaleSpecification locale)
      Authenticate user in the application; actual authentication performed by Spring Security in client app
      Parameters:
      request -
      response -
      role - Required role; TODO: Used to switch role from UI, consider separate endpoint for that
      timezone -
      locale - Required locale TODO: Consider separate endpoint to switch language from UI
      Returns:
    • logout

      @RequestMapping(method=GET, value="/logout") public ResponseDTO logout()
      Logout endpoint, actual session is usually cleared by client application by specifying this endpoint as `logoutUrl` of Spring Security configuration
      Returns:
      Empty list
    • resetLocaleContext

      protected void resetLocaleContext(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.cxbox.api.util.tz.TimeZoneSpecification timezone, org.cxbox.api.util.locale.LocaleSpecification locale)
    • getLocale

      protected Locale getLocale(org.springframework.context.i18n.LocaleContext context, org.cxbox.api.util.locale.LocaleSpecification locale)
    • getTimezone

      protected TimeZone getTimezone(org.springframework.context.i18n.LocaleContext context, org.cxbox.api.util.tz.TimeZoneSpecification timezone)