Beispiel #1
0
        /**
         * Save off our new token and secret to the persistent store.
         *
         * @throws GadgetException
         */
        private void saveAccessToken()
        {
            OAuthAccessor accessor = accessorInfo.getAccessor();

            OAuthStore.TokenInfo tokenInfo = new OAuthStore.TokenInfo(accessor.accessToken, accessor.TokenSecret,
                                                                      accessorInfo.getSessionHandle(), accessorInfo.getTokenExpireMillis());
            fetcherConfig.getTokenStore().storeTokenKeyAndSecret(realRequest.getSecurityToken(),
                                                                 accessorInfo.getConsumer(), realRequest.getOAuthArguments(), tokenInfo, responseParams);
        }
 /**
  * Store an access token for the given user/gadget/service/token name
  */
 public void storeTokenKeyAndSecret(ISecurityToken securityToken, OAuthStore.ConsumerInfo consumerInfo,
                                    OAuthArguments arguments, OAuthStore.TokenInfo tokenInfo, OAuthResponseParams responseParams)
 {
     try
     {
         store.setTokenInfo(securityToken, consumerInfo, arguments.getServiceName(),
                            arguments.getTokenName(), tokenInfo);
     }
     catch (GadgetException e)
     {
         throw responseParams.oauthRequestException(OAuthError.UNKNOWN_PROBLEM,
                                                    "Unable to store access token", e);
     }
 }
Beispiel #3
0
 /**
 * Save off our new token and secret to the persistent store.
 *
 * @throws GadgetException
 */
 private void saveAccessToken()
 {
     OAuthAccessor accessor = accessorInfo.getAccessor();
     OAuthStore.TokenInfo tokenInfo = new OAuthStore.TokenInfo(accessor.accessToken, accessor.TokenSecret,
                             accessorInfo.getSessionHandle(), accessorInfo.getTokenExpireMillis());
     fetcherConfig.getTokenStore().storeTokenKeyAndSecret(realRequest.getSecurityToken(),
                                                          accessorInfo.getConsumer(), realRequest.getOAuthArguments(), tokenInfo, responseParams);
 }