Class LoginController


  • @RestController
    @RequestMapping("#{ (${cxbox.api.use-servlet-context-path} == true) ? \'\':  \'${cxbox.api.path}\'}")
    public class LoginController
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LoginController()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LoggedUser get​(javax.servlet.http.HttpServletRequest request, javax.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)  
      ResponseDTO logout()
      Logout endpoint, actual session is usually cleared by client application by specifying this endpoint as `logoutUrl` of Spring Security configuration
      protected void resetLocaleContext​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.cxbox.api.util.tz.TimeZoneSpecification timezone, org.cxbox.api.util.locale.LocaleSpecification locale)  
    • Constructor Detail

      • LoginController

        public LoginController()
    • Method Detail

      • get

        @RequestMapping(method=GET,
                        value="/login")
        public LoggedUser get​(javax.servlet.http.HttpServletRequest request,
                              javax.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​(javax.servlet.http.HttpServletRequest request,
                                          javax.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)