/** * Get the security token for this request. * * @return The security token */ public SecurityToken getSecurityToken() { return AuthInfoUtil.getSecurityTokenFromRequest(req); }
/** * Get the hosted domain for this request. * * @return The domain, or {@code null} if no domain was found */ public String getAuthType() { return AuthInfoUtil.getAuthTypeFromRequest(req); } }
/** * Get the hosted domain for this request. * * @return The domain, or {@code null} if no domain was found */ public static String getAuthTypeFromRequest(HttpServletRequest req) { return getRequestAttribute(req, Attribute.AUTH_TYPE); }
@Test public void testToken() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); SecurityToken token = new FakeGadgetToken(); AuthInfoUtil.setSecurityTokenForRequest(req, token); assertEquals(token, AuthInfoUtil.getSecurityTokenFromRequest(req)); }
@Test public void testAuthType() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); AuthInfoUtil.setAuthTypeForRequest(req, "FakeAuth"); assertEquals("FakeAuth", AuthInfoUtil.getAuthTypeFromRequest(req)); } }
SecurityToken token = handler.getSecurityTokenFromRequest(req); if (token != null) { AuthInfoUtil.setAuthTypeForRequest(req, handler.getName()); AuthInfoUtil.setSecurityTokenForRequest(req, token); callChain(chain, req, resp); return;
/** * Set the security token for the request. * * @param req The request object * @param token The security token */ public static void setSecurityTokenForRequest(HttpServletRequest req, SecurityToken token) { setRequestAttribute(req, Attribute.SECURITY_TOKEN, token); }
@Test public void testToken() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); SecurityToken token = new FakeGadgetToken(); AuthInfoUtil.setSecurityTokenForRequest(req, token); assertEquals(token, AuthInfoUtil.getSecurityTokenFromRequest(req)); }
@Test public void testAuthType() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); AuthInfoUtil.setAuthTypeForRequest(req, "FakeAuth"); assertEquals("FakeAuth", AuthInfoUtil.getAuthTypeFromRequest(req)); } }
SecurityToken token = handler.getSecurityTokenFromRequest(req); if (token != null) { AuthInfoUtil.setAuthTypeForRequest(req, handler.getName()); AuthInfoUtil.setSecurityTokenForRequest(req, token); callChain(chain, req, resp); return;
/** * Set the auth type for the request. * * @param req The request object * @param authType The named auth type */ public static void setAuthTypeForRequest(HttpServletRequest req, String authType) { setRequestAttribute(req, Attribute.AUTH_TYPE, authType); }
/** * Get the security token for this request. * * @return The security token */ public SecurityToken getSecurityToken() { return AuthInfoUtil.getSecurityTokenFromRequest(req); }
@Test public void testToken() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); SecurityToken token = new FakeGadgetToken(); AuthInfoUtil.setSecurityTokenForRequest(req, token); assertEquals(token, AuthInfoUtil.getSecurityTokenFromRequest(req)); }
@Test public void testAuthType() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); AuthInfoUtil.setAuthTypeForRequest(req, "FakeAuth"); assertEquals("FakeAuth", AuthInfoUtil.getAuthTypeFromRequest(req)); } }
SecurityToken token = handler.getSecurityTokenFromRequest(req); if (token != null) { AuthInfoUtil.setAuthTypeForRequest(req, handler.getName()); AuthInfoUtil.setSecurityTokenForRequest(req, token); callChain(chain, req, resp); return;
/** * Get the hosted domain for this request. * * @return The domain, or {@code null} if no domain was found */ public String getAuthType() { return AuthInfoUtil.getAuthTypeFromRequest(req); } }
/** * Get the hosted domain for this request. * * @return The domain, or {@code null} if no domain was found */ public static String getAuthTypeFromRequest(HttpServletRequest req) { return getRequestAttribute(req, Attribute.AUTH_TYPE); }
/** * Set the security token for the request. * * @param req The request object * @param token The security token */ public static void setSecurityTokenForRequest(HttpServletRequest req, SecurityToken token) { setRequestAttribute(req, Attribute.SECURITY_TOKEN, token); }
protected SecurityToken getSecurityToken(HttpServletRequest servletRequest) { return AuthInfoUtil.getSecurityTokenFromRequest(servletRequest); }
/** * Get the hosted domain for this request. * * @return The domain, or {@code null} if no domain was found */ public String getAuthType() { return AuthInfoUtil.getAuthTypeFromRequest(req); } }