I am trying to store an OAuth1 token in the session so I can make subsequent API calls in another method after I redirect the user to a URL after the callback has taken place. To do this for OAuth2 I do the following:
$accessToken = $facebookService->requestAccessToken($_GET[code']);
$token = new StdOAuth2Token;
$token->setAccessToken($accessToken->getAccessToken());
$storage->storeAccessToken('Facebook', $token);
After I redirect I make a request like the following an the access token is used properly from the stored token in session:
I am trying to store an OAuth1 token in the session so I can make subsequent API calls in another method after I redirect the user to a URL after the callback has taken place. To do this for OAuth2 I do the following:
$accessToken = $facebookService->requestAccessToken($_GET[code']); $token = new StdOAuth2Token; $token->setAccessToken($accessToken->getAccessToken()); $storage->storeAccessToken('Facebook', $token);
After I redirect I make a request like the following an the access token is used properly from the stored token in session:
$user = json_decode($facebookService->request('/me'), true);
I am trying to get this working for OAuth1 (Twitter/Yahoo) but I get 401 unauthorized when I try to do so. I am storing the token for this like:
$token = new StdOAuth1Token; $token->setAccessToken($accessToken->getAccessToken()); $token->setAccessTokenSecret($accessToken->getRequestTokenSecret()); $storage->storeAccessToken('Yahoo', $token);
Are there any know issues with storing OAuth1 tokens in the session?