Author: mbrohl
Date: Mon Feb 4 09:26:12 2019 New Revision: 1852883 URL: http://svn.apache.org/viewvc?rev=1852883&view=rev Log: Applied fix from trunk for revision: 1849931 === Improved: Token Based Authentication (OFBIZ-9833) Just few typos and import ordering while reviewing for OFBIZ-4361 Modified: ofbiz/ofbiz-framework/branches/release18.12/ (props changed) ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java Propchange: ofbiz/ofbiz-framework/branches/release18.12/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 4 09:26:12 2019 @@ -10,4 +10,4 @@ /ofbiz/branches/json-integration-refactoring:1634077-1635900 /ofbiz/branches/multitenant20100310:921280-927264 /ofbiz/branches/release13.07:1547657 -/ofbiz/ofbiz-framework/trunk:1850015,1850023,1850530,1850647,1850685,1850694,1850711,1850914,1850918,1850921,1850948,1850953,1851006,1851013,1851068,1851074,1851130,1851158,1851200,1851224,1851247,1851254,1851315,1851319,1851350,1851353,1851433,1851500,1851805,1851885,1851998,1852503,1852587,1852818 +/ofbiz/ofbiz-framework/trunk:1849931,1850015,1850023,1850530,1850647,1850685,1850694,1850711,1850914,1850918,1850921,1850948,1850953,1851006,1851013,1851068,1851074,1851130,1851158,1851200,1851224,1851247,1851254,1851315,1851319,1851350,1851353,1851433,1851500,1851805,1851885,1851998,1852503,1852587,1852818 Modified: ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java?rev=1852883&r1=1852882&r2=1852883&view=diff ============================================================================== --- ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java (original) +++ ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java Mon Feb 4 09:26:12 2019 @@ -149,7 +149,7 @@ public class JWTManager { * * @param delegator * @param tokenMap Map name, value pairs to set as claims - * @param expirationtime the expiration time in seconds + * @param expireTime the expiration time in seconds * @return a JWT token */ public static String createJwt (Delegator delegator, Map<String, String> claims, int expireTime) { Modified: ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java?rev=1852883&r1=1852882&r2=1852883&view=diff ============================================================================== --- ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java (original) +++ ofbiz/ofbiz-framework/branches/release18.12/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java Mon Feb 4 09:26:12 2019 @@ -18,6 +18,20 @@ */ package org.apache.ofbiz.webapp.control; +import java.io.IOException; +import java.util.Locale; +import java.util.Map; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilHttp; import org.apache.ofbiz.base.util.UtilMisc; @@ -30,19 +44,6 @@ import org.apache.ofbiz.entity.GenericVa import org.apache.ofbiz.entity.util.EntityQuery; import org.apache.ofbiz.service.ModelService; import org.apache.ofbiz.webapp.WebAppUtil; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.util.Locale; -import java.util.Map; public class TokenFilter implements Filter { public static final String module = TokenFilter.class.getName(); @@ -73,7 +74,7 @@ public class TokenFilter implements Filt try { GenericValue userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", userLoginId).queryOne(); if (userLogin != null && !"N".equals(userLogin.getString("enabled"))) { - //FIXME: This is not good way for api, but session is required to get the userLogin while performing auth check + //FIXME: This is not good way for API, but session is required to get the userLogin while performing auth check HttpSession session = httpRequest.getSession(); session.setAttribute("userLogin", userLogin); chain.doFilter(httpRequest, httpResponse); |
Free forum by Nabble | Edit this page |