congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.apache.shindig.gadgets.oauth
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.shindig.gadgets.oauth

Best Java code snippets using org.apache.shindig.gadgets.oauth (Showing top 20 results out of 315)

origin: org.apache.shindig/shindig-gadgets

/**
 * Store an access token for the given user/gadget/service/token name
 */
public void storeTokenKeyAndSecret(SecurityToken securityToken, ConsumerInfo consumerInfo,
  OAuthArguments arguments, TokenInfo tokenInfo, OAuthResponseParams responseParams)
  throws OAuthRequestException {
 try {
  store.setTokenInfo(securityToken, consumerInfo, arguments.getServiceName(),
    arguments.getTokenName(), tokenInfo);
 } catch (GadgetException e) {
  throw new OAuthRequestException(OAuthError.UNKNOWN_PROBLEM,
    "Unable to store access token", e);
 }
}
origin: org.apache.shindig/shindig-gadgets

 /**
  * Remove an access token for the given user/gadget/service/token name
  */
 public void removeToken(SecurityToken securityToken, ConsumerInfo consumerInfo,
   OAuthArguments arguments, OAuthResponseParams responseParams) throws OAuthRequestException {
  try {
   store.removeToken(securityToken, consumerInfo, arguments.getServiceName(),
     arguments.getTokenName());
  } catch (GadgetException e) {
   throw new OAuthRequestException(OAuthError.UNKNOWN_PROBLEM,
     "Unable to remove access token", e);
  }
 }
}
origin: org.apache.shindig/shindig-gadgets

/**
 * Save off our new token and secret to the persistent store.
 */
private void saveAccessToken() throws OAuthRequestException {
 OAuthAccessor accessor = accessorInfo.getAccessor();
 TokenInfo tokenInfo = new TokenInfo(accessor.accessToken, accessor.tokenSecret,
   accessorInfo.getSessionHandle(), accessorInfo.getTokenExpireMillis());
 fetcherConfig.getTokenStore().storeTokenKeyAndSecret(realRequest.getSecurityToken(),
   accessorInfo.getConsumer(), realRequest.getOAuthArguments(), tokenInfo, responseParams);
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

private static void addConsumer(
  BasicOAuthStore base,
  String gadgetUrl,
  String serviceName,
  String consumerKey,
  String consumerSecret) {
 BasicOAuthStoreConsumerIndex providerKey = new BasicOAuthStoreConsumerIndex();
 providerKey.setGadgetUri(gadgetUrl);
 providerKey.setServiceName(serviceName);
 BasicOAuthStoreConsumerKeyAndSecret kas = new BasicOAuthStoreConsumerKeyAndSecret(
   consumerKey, consumerSecret, KeyType.HMAC_SYMMETRIC, null, null);
 base.setConsumerKeyAndSecret(providerKey, kas);
}
origin: org.apache.shindig/shindig-gadgets

/**
 * Do we need to exchange a request token for an access token?
 */
private boolean needAccessToken() {
 if (realRequest.getOAuthArguments().mustUseToken()
   && accessorInfo.getAccessor().requestToken != null
   && accessorInfo.getAccessor().accessToken == null) {
  return true;
 }
 return realRequest.getOAuthArguments().mayUseToken() && accessTokenExpired();
}
origin: org.apache.shindig/shindig-gadgets

 public boolean matches(Object argument) {
  if (!(argument instanceof OAuthGadgetContext)) {
   return false;
  }
  OAuthGadgetContext context = (OAuthGadgetContext) argument;
  return (securityToken == context.getToken() &&
    arguments.getBypassSpecCache() == context.getIgnoreCache());
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

private static void addDefaultKey(BasicOAuthStore base) {
 BasicOAuthStoreConsumerKeyAndSecret defaultKey = new BasicOAuthStoreConsumerKeyAndSecret(
   "signedfetch", FakeOAuthServiceProvider.PRIVATE_KEY_TEXT, KeyType.RSA_PRIVATE, "foo", null);
 base.setDefaultKey(defaultKey);
}
origin: com.lmco.shindig/shindig-gadgets

/**
 * Save off our new token and secret to the persistent store.
 */
private void saveAccessToken() throws OAuthRequestException {
 OAuthAccessor accessor = accessorInfo.getAccessor();
 TokenInfo tokenInfo = new TokenInfo(accessor.accessToken, accessor.tokenSecret,
   accessorInfo.getSessionHandle(), accessorInfo.getTokenExpireMillis());
 fetcherConfig.getTokenStore().storeTokenKeyAndSecret(realRequest.getSecurityToken(),
   accessorInfo.getConsumer(), realRequest.getOAuthArguments(), tokenInfo, responseParams);
}
origin: com.lmco.shindig/shindig-gadgets

private static void addConsumer(
  BasicOAuthStore base,
  String gadgetUrl,
  String serviceName,
  String consumerKey,
  String consumerSecret) {
 BasicOAuthStoreConsumerIndex providerKey = new BasicOAuthStoreConsumerIndex();
 providerKey.setGadgetUri(gadgetUrl);
 providerKey.setServiceName(serviceName);
 BasicOAuthStoreConsumerKeyAndSecret kas = new BasicOAuthStoreConsumerKeyAndSecret(
   consumerKey, consumerSecret, KeyType.HMAC_SYMMETRIC, null, null);
 base.setConsumerKeyAndSecret(providerKey, kas);
}
origin: com.lmco.shindig/shindig-gadgets

/**
 * Store an access token for the given user/gadget/service/token name
 */
public void storeTokenKeyAndSecret(SecurityToken securityToken, ConsumerInfo consumerInfo,
  OAuthArguments arguments, TokenInfo tokenInfo, OAuthResponseParams responseParams)
  throws OAuthRequestException {
 try {
  store.setTokenInfo(securityToken, consumerInfo, arguments.getServiceName(),
    arguments.getTokenName(), tokenInfo);
 } catch (GadgetException e) {
  throw new OAuthRequestException(OAuthError.UNKNOWN_PROBLEM,
    "Unable to store access token", e);
 }
}
origin: org.gatein.shindig/shindig-gadgets

 /**
  * Remove an access token for the given user/gadget/service/token name
  */
 public void removeToken(SecurityToken securityToken, ConsumerInfo consumerInfo,
   OAuthArguments arguments, OAuthResponseParams responseParams) throws OAuthRequestException {
  try {
   store.removeToken(securityToken, consumerInfo, arguments.getServiceName(),
     arguments.getTokenName());
  } catch (GadgetException e) {
   throw new OAuthRequestException(OAuthError.UNKNOWN_PROBLEM,
     "Unable to remove access token", e);
  }
 }
}
origin: org.gatein.shindig/shindig-gadgets

/**
 * Do we need to exchange a request token for an access token?
 */
private boolean needAccessToken() {
 if (realRequest.getOAuthArguments().mustUseToken()
   && accessorInfo.getAccessor().requestToken != null
   && accessorInfo.getAccessor().accessToken == null) {
  return true;
 }
 return realRequest.getOAuthArguments().mayUseToken() && accessTokenExpired();
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

 public boolean matches(Object argument) {
  if (!(argument instanceof OAuthGadgetContext)) {
   return false;
  }
  OAuthGadgetContext context = (OAuthGadgetContext) argument;
  return (securityToken == context.getToken() &&
    arguments.getBypassSpecCache() == context.getIgnoreCache());
}
origin: com.lmco.shindig/shindig-gadgets

private static void addDefaultKey(BasicOAuthStore base) {
 BasicOAuthStoreConsumerKeyAndSecret defaultKey = new BasicOAuthStoreConsumerKeyAndSecret(
   "signedfetch", FakeOAuthServiceProvider.PRIVATE_KEY_TEXT, KeyType.RSA_PRIVATE, "foo", null);
 base.setDefaultKey(defaultKey);
}
origin: org.gatein.shindig/shindig-gadgets

/**
 * Save off our new token and secret to the persistent store.
 */
private void saveAccessToken() throws OAuthRequestException {
 OAuthAccessor accessor = accessorInfo.getAccessor();
 TokenInfo tokenInfo = new TokenInfo(accessor.accessToken, accessor.tokenSecret,
   accessorInfo.getSessionHandle(), accessorInfo.getTokenExpireMillis());
 fetcherConfig.getTokenStore().storeTokenKeyAndSecret(realRequest.getSecurityToken(),
   accessorInfo.getConsumer(), realRequest.getOAuthArguments(), tokenInfo, responseParams);
}
origin: org.apache.shindig/shindig-gadgets

private static void addConsumer(
  BasicOAuthStore base,
  String gadgetUrl,
  String serviceName,
  String consumerKey,
  String consumerSecret) {
 BasicOAuthStoreConsumerIndex providerKey = new BasicOAuthStoreConsumerIndex();
 providerKey.setGadgetUri(gadgetUrl);
 providerKey.setServiceName(serviceName);
 BasicOAuthStoreConsumerKeyAndSecret kas = new BasicOAuthStoreConsumerKeyAndSecret(
   consumerKey, consumerSecret, KeyType.HMAC_SYMMETRIC, null, null);
 base.setConsumerKeyAndSecret(providerKey, kas);
}
origin: org.gatein.shindig/shindig-gadgets

/**
 * Store an access token for the given user/gadget/service/token name
 */
public void storeTokenKeyAndSecret(SecurityToken securityToken, ConsumerInfo consumerInfo,
  OAuthArguments arguments, TokenInfo tokenInfo, OAuthResponseParams responseParams)
  throws OAuthRequestException {
 try {
  store.setTokenInfo(securityToken, consumerInfo, arguments.getServiceName(),
    arguments.getTokenName(), tokenInfo);
 } catch (GadgetException e) {
  throw new OAuthRequestException(OAuthError.UNKNOWN_PROBLEM,
    "Unable to store access token", e);
 }
}
origin: com.lmco.shindig/shindig-gadgets

/**
 * Do we need to exchange a request token for an access token?
 */
private boolean needAccessToken() {
 if (realRequest.getOAuthArguments().mustUseToken()
   && accessorInfo.getAccessor().requestToken != null
   && accessorInfo.getAccessor().accessToken == null) {
  return true;
 }
 return realRequest.getOAuthArguments().mayUseToken() && accessTokenExpired();
}
origin: com.lmco.shindig/shindig-gadgets

 public boolean matches(Object argument) {
  if (!(argument instanceof OAuthGadgetContext)) {
   return false;
  }
  OAuthGadgetContext context = (OAuthGadgetContext) argument;
  return (securityToken == context.getToken() &&
    arguments.getBypassSpecCache() == context.getIgnoreCache());
}
origin: org.apache.shindig/shindig-gadgets

private static void addDefaultKey(BasicOAuthStore base) {
 BasicOAuthStoreConsumerKeyAndSecret defaultKey = new BasicOAuthStoreConsumerKeyAndSecret(
   "signedfetch", FakeOAuthServiceProvider.PRIVATE_KEY_TEXT, KeyType.RSA_PRIVATE, "foo", null);
 base.setDefaultKey(defaultKey);
}
org.apache.shindig.gadgets.oauth

Most used classes

  • OAuthModule
    Loads pre-reqs for OAuth.
  • AccessorInfo
    OAuth related data accessor
  • BasicOAuthStore
    Simple implementation of the OAuthStore interface. We use a in-memory hash map. If initialized with
  • BasicOAuthStoreConsumerIndex
    Index into the token store by
  • BasicOAuthStoreConsumerKeyAndSecret
    Data structure representing and OAuth consumer key and secret
  • GadgetOAuthCallbackGenerator,
  • GadgetOAuthTokenStore,
  • OAuthArguments,
  • OAuthCallbackState,
  • OAuthClientState,
  • OAuthError,
  • OAuthFetcherConfig,
  • OAuthGadgetContext,
  • OAuthRequest,
  • OAuthRequestException,
  • OAuthResponseParams,
  • OAuthStore$ConsumerInfo,
  • OAuthStore$TokenInfo,
  • AccessorInfo$HttpMethod
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now