Author: jleroux
Date: Sat Dec 29 17:22:37 2018 New Revision: 1849931 URL: http://svn.apache.org/viewvc?rev=1849931&view=rev Log: Improved: Token Based Authentication (OFBIZ-9833) Just few typos and import ordering while reviewing for OFBIZ-4361 Modified: ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java Modified: ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java?rev=1849931&r1=1849930&r2=1849931&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/JWTManager.java Sat Dec 29 17:22:37 2018 @@ -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/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java?rev=1849931&r1=1849930&r2=1849931&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/TokenFilter.java Sat Dec 29 17:22:37 2018 @@ -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 |