Package org.cxbox.core.controller
Class LoginController
java.lang.Object
org.cxbox.core.controller.LoginController
@RestController
@RequestMapping("#{\'${cxbox.api.path}\'}")
public class LoginController
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(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 appprotected LocalegetLocale(org.springframework.context.i18n.LocaleContext context, org.cxbox.api.util.locale.LocaleSpecification locale) protected TimeZonegetTimezone(org.springframework.context.i18n.LocaleContext context, org.cxbox.api.util.tz.TimeZoneSpecification timezone) logout()Logout endpoint, actual session is usually cleared by client application by specifying this endpoint as `logoutUrl` of Spring Security configurationprotected voidresetLocaleContext(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.cxbox.api.util.tz.TimeZoneSpecification timezone, org.cxbox.api.util.locale.LocaleSpecification locale)
-
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 thattimezone-locale- Required locale TODO: Consider separate endpoint to switch language from UI- Returns:
-
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)
-