Fixed: Correct behaviour of Autologin cookies

(OFBIZ-10635)

Renames "keep-autologin-cookie" to "use-autologin-cookie", and only create 
Autologin cookies when needed. No need to create Autologin cookies in 
applications that don't need it.

Don't pass webAppName to LoginWorker::getSecuredUserLoginId, that can be handled
with improved LoginWorker::getSecuredLoginIdCookieName

Removes LoginWorker::autoLogoutCleanCookies, no longer needed since only those
needed are created and kept (1 year at least after creation).

For both autoLogin and securedLoginId cookies sets the path to the application.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845558 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2018-11-02 09:46:42 +00:00
parent a1e28bf1e2
commit 102dd5d242
4 changed files with 22 additions and 75 deletions
@@ -384,8 +384,7 @@ public class CommonEvents {
public static String loadJWT(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException {
Delegator delegator = (Delegator) request.getAttribute("delegator");
Map<String, String> types = new HashMap<>();
String webAppName = UtilHttp.getApplicationName(request);
String securedUserLoginId = LoginWorker.getSecuredUserLoginId(request, webAppName);
String securedUserLoginId = LoginWorker.getSecuredUserLoginId(request);
if (securedUserLoginId != null) {
types.put("userLoginId", securedUserLoginId);
int ttlSeconds = (int) Long.parseLong(EntityUtilProperties.getPropertyValue("security", "security.jwt.token.expireTime", "10", delegator));