/** * @return The token associated with this request */ public SecurityToken getToken() { return delegate == null ? null : delegate.getToken(); }
/** * @return The token associated with this request */ public SecurityToken getToken() { return delegate == null ? null : delegate.getToken(); }
/** * @return The token associated with this request */ public SecurityToken getToken() { return delegate == null ? null : delegate.getToken(); }
protected String generateSecurityToken(Gadget gadget) { // Find a security token in the context try { SecurityToken token = gadget.getContext().getToken(); if (securityTokenCodec != null && token != null) { return securityTokenCodec.encodeToken(token); } } catch (SecurityTokenException e) { // ignore -- no security token } return null; }
protected String generateSecurityToken(Gadget gadget) { // Find a security token in the context try { SecurityToken token = gadget.getContext().getToken(); if (securityTokenCodec != null && token != null) { return securityTokenCodec.encodeToken(token); } } catch (SecurityTokenException e) { // ignore -- no security token } return null; }
protected String generateSecurityToken(Gadget gadget) { // Find a security token in the context try { SecurityToken token = gadget.getContext().getToken(); if (securityTokenCodec != null && token != null) { return securityTokenCodec.encodeToken(token); } } catch (SecurityTokenException e) { // ignore -- no security token } return null; }
/** {@inheritDoc} */ public void contribute(Map<String,Object> config, Gadget gadget) { final GadgetContext context = gadget.getContext(); final SecurityToken authToken = context.getToken(); if (authToken != null) { Map<String, String> authConfig = Maps.newHashMapWithExpectedSize(2); String updatedToken = authToken.getUpdatedToken(); if (updatedToken != null) { authConfig.put("authToken", updatedToken); } String trustedJson = authToken.getTrustedJson(); if (trustedJson != null) { authConfig.put("trustedJson", trustedJson); } config.put("shindig.auth", authConfig); } }
/** {@inheritDoc} */ public void contribute(Map<String,Object> config, Gadget gadget) { final GadgetContext context = gadget.getContext(); final SecurityToken authToken = context.getToken(); if (authToken != null) { Map<String, String> authConfig = Maps.newHashMapWithExpectedSize(2); String updatedToken = authToken.getUpdatedToken(); if (updatedToken != null) { authConfig.put("authToken", updatedToken); } String trustedJson = authToken.getTrustedJson(); if (trustedJson != null) { authConfig.put("trustedJson", trustedJson); } config.put("shindig.auth", authConfig); } }
/** {@inheritDoc} */ public void contribute(Map<String,Object> config, Gadget gadget) { final GadgetContext context = gadget.getContext(); final SecurityToken authToken = context.getToken(); if (authToken != null) { Map<String, String> authConfig = Maps.newHashMapWithExpectedSize(2); String updatedToken = authToken.getUpdatedToken(); if (updatedToken != null) { authConfig.put("authToken", updatedToken); } String trustedJson = authToken.getTrustedJson(); if (trustedJson != null) { authConfig.put("trustedJson", trustedJson); } config.put("shindig.auth", authConfig); } }
@Test public void testGetSecurityToken() throws Exception { SecurityToken expected = new AnonymousSecurityToken(); expect(request.getAttribute(AuthInfoUtil.Attribute.SECURITY_TOKEN.getId())).andReturn(expected); replay(); GadgetContext context = new HttpGadgetContext(request); assertEquals(expected, context.getToken()); }
@Test public void testGetSecurityToken() throws Exception { SecurityToken expected = new AnonymousSecurityToken(); expect(request.getAttribute(AuthInfo.Attribute.SECURITY_TOKEN.getId())).andReturn(expected); replay(); GadgetContext context = new HttpGadgetContext(request); assertEquals(expected, context.getToken()); }
@Test public void testGetSecurityToken() throws Exception { SecurityToken expected = new AnonymousSecurityToken(); expect(request.getAttribute(AuthInfoUtil.Attribute.SECURITY_TOKEN.getId())).andReturn(expected); replay(); GadgetContext context = new HttpGadgetContext(request); assertEquals(expected, context.getToken()); }
public static HttpRequest newHttpRequest(GadgetContext context, RequestAuthenticationInfo authenticationInfo) throws GadgetException { return new HttpRequest(authenticationInfo.getHref()) .setSecurityToken(context.getToken()) .setOAuthArguments(new OAuthArguments(authenticationInfo)) .setAuthType(authenticationInfo.getAuthType()) .setContainer(context.getContainer()) .setGadget(context.getUrl()) .setIgnoreCache(context.getIgnoreCache()); }
public static HttpRequest newHttpRequest(GadgetContext context, RequestAuthenticationInfo authenticationInfo) throws GadgetException { return new HttpRequest(authenticationInfo.getHref()) .setSecurityToken(context.getToken()) .setOAuthArguments(new OAuthArguments(authenticationInfo)) .setAuthType(authenticationInfo.getAuthType()) .setContainer(context.getContainer()) .setGadget(context.getUrl()) .setIgnoreCache(context.getIgnoreCache()); }
public static HttpRequest newHttpRequest(GadgetContext context, RequestAuthenticationInfo authenticationInfo) throws GadgetException { return new HttpRequest(authenticationInfo.getHref()) .setSecurityToken(context.getToken()) .setOAuthArguments(new OAuthArguments(authenticationInfo)) .setOAuth2Arguments(new OAuth2Arguments(authenticationInfo)) .setAuthType(authenticationInfo.getAuthType()) .setContainer(context.getContainer()) .setGadget(context.getUrl()) .setIgnoreCache(context.getIgnoreCache()); }
private void checkRequest(HttpRequest request) { assertEquals(context.getContainer(), request.getContainer()); assertEquals(GADGET_URL.toString(), request.getGadget().toString()); assertEquals(context.getToken().getAppId(), request.getSecurityToken().getAppId()); }
private void checkRequest(HttpRequest request) { assertEquals(context.getContainer(), request.getContainer()); assertEquals(GADGET_URL.toString(), request.getGadget().toString()); assertEquals(context.getToken().getAppId(), request.getSecurityToken().getAppId()); }
private void checkRequest(HttpRequest request) { assertEquals(context.getContainer(), request.getContainer()); assertEquals(GADGET_URL.toString(), request.getGadget().toString()); assertEquals(context.getToken().getAppId(), request.getSecurityToken().getAppId()); }
HttpRequest request = new HttpRequest(uri) .setIgnoreCache(context.getIgnoreCache()) .setSecurityToken(context.getToken()) .setMethod("POST") .setAuthType(AuthType.NONE)
HttpRequest request = new HttpRequest(uri) .setIgnoreCache(context.getIgnoreCache()) .setSecurityToken(context.getToken()) .setMethod("POST") .setAuthType(AuthType.NONE)