PHP Classes

What to use after getting token/secret

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  What to use after getting token/secret  >  (Un) Subscribe thread alerts  
Subject:What to use after getting token/secret
Summary:What to use after getting token/secret
Messages:4
Author:roy king
Date:2014-04-18 20:22:33
Update:2014-04-19 13:59:03
 

  1. What to use after getting token/secret   Reply   Report abuse  
Picture of roy king roy king - 2014-04-18 20:22:33
After I get the token a secret back, and store them, how to I use them? In other oauth scripts, I just replaced my apps token/secret with the one obtained, and then was able to pull data. That doesnt seem to work here, or I am doing something wrong.

  2. Re: What to use after getting token/secret   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-04-19 04:12:57 - In reply to message 1 from roy king
I am not sure if this is what you are asking, but by default this class uses sessions to store access tokens and secrets. If you want to access API from offline scripts when the user is not present, sessions will not do for recovering retrieved tokens.

You need to store the obtained tokens and restore them, or use a sub-class that stores the tokens on a persistent storage container, like a database.

There are sub-classes for storing the tokens in databases, like for instance MySQL.

Read this article to learn how to implement a client that stores and retrieves tokens for offline usage:

phpclasses.org/blog/package/7700/po ...

  3. Re: What to use after getting token/secret   Reply   Report abuse  
Picture of roy king roy king - 2014-04-19 13:27:53 - In reply to message 2 from Manuel Lemos
Yes, I am storing the ones obtained by your script in mysql. Then I can retrieve them using the user id for that "server", but what script do I use to logon using those tokens and get the data.

  4. Re: What to use after getting token/secret   Reply   Report abuse  
Picture of roy king roy king - 2014-04-19 13:59:03 - In reply to message 3 from roy king
I figured it out. i have to use the offline access scripts. sorry for the dumb question.