Package io.tesler.core.controller
Class LoginController
- java.lang.Object
-
- io.tesler.core.controller.LoginController
-
@RestController @RequestMapping("#{ (${tesler.api.use-servlet-context-path} == true) ? \'\': \'${tesler.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, TimeZoneSpecification timezone, LocaleSpecification locale)
Authenticate user in the application; actual authentication performed by Spring Security in client appprotected Locale
getLocale(org.springframework.context.i18n.LocaleContext context, LocaleSpecification locale)
protected TimeZone
getTimezone(org.springframework.context.i18n.LocaleContext context, TimeZoneSpecification timezone)
ResponseDTO
logout()
Logout endpoint, actual session is usually cleared by client application by specifying this endpoint as `logoutUrl` of Spring Security configurationprotected void
resetLocaleContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, TimeZoneSpecification timezone, 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, TimeZoneSpecification timezone, 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, TimeZoneSpecification timezone, LocaleSpecification locale)
-
getLocale
protected Locale getLocale(org.springframework.context.i18n.LocaleContext context, LocaleSpecification locale)
-
getTimezone
protected TimeZone getTimezone(org.springframework.context.i18n.LocaleContext context, TimeZoneSpecification timezone)
-
-