Package org.cxbox.core.controller
Class LoginController
- java.lang.Object
-
- org.cxbox.core.controller.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 LoggedUserget(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 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)ResponseDTOlogout()Logout endpoint, actual session is usually cleared by client application by specifying this endpoint as `logoutUrl` of Spring Security configurationprotected voidresetLocaleContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.cxbox.api.util.tz.TimeZoneSpecification timezone, org.cxbox.api.util.locale.LocaleSpecification locale)
-
-
-
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 thattimezone-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)
-
-