2012-08-09, 10:07 PM
I am rewriting MyBBPublisher from scratch and adding modules for additional services. These services use OAuth but don't have a pre-made library/wrapper.
Luckily Twitter is a good set of libraries available, but Twitter also offers user Access Tokens and Access Token Secrets directly from their developer website when you are creating your app. No need to go through the trouble of generating them yourself.
However, Tumblr (and most other providers) does not offer the token/secret directly like Twitter does, so I have to make the calls to the API to get that data. This requires multiple calls to the ACP page since I don't want a separate page to process the callback and with this, I need to temporarily store the original request token so I can access it after the ACP is reloaded. I can't use PHP session or cookies as the headers are already sent so I have to hijack the $admin_sesssion to store the temp variables. The original request token is needed to obtain the verifier code and the final access tokens. Very frustrating at times.
I was able to modify the Twitter OAuth library I was using (credited of course) to work with Tumblr.
That all said, writing OAuth is a PITA and gets confusing at times, but I think I have it down now. So Tumblr support for MyBBPublisher is almost ready and next is LinkedIn.
After this bit of work, I might be able to make a Steam plugin (that one may be paid though) since it uses OAuth as well.
okay, sorry for the venting, but I am glad that I finally figured it out.
Luckily Twitter is a good set of libraries available, but Twitter also offers user Access Tokens and Access Token Secrets directly from their developer website when you are creating your app. No need to go through the trouble of generating them yourself.
However, Tumblr (and most other providers) does not offer the token/secret directly like Twitter does, so I have to make the calls to the API to get that data. This requires multiple calls to the ACP page since I don't want a separate page to process the callback and with this, I need to temporarily store the original request token so I can access it after the ACP is reloaded. I can't use PHP session or cookies as the headers are already sent so I have to hijack the $admin_sesssion to store the temp variables. The original request token is needed to obtain the verifier code and the final access tokens. Very frustrating at times.
I was able to modify the Twitter OAuth library I was using (credited of course) to work with Tumblr.
That all said, writing OAuth is a PITA and gets confusing at times, but I think I have it down now. So Tumblr support for MyBBPublisher is almost ready and next is LinkedIn.
After this bit of work, I might be able to make a Steam plugin (that one may be paid though) since it uses OAuth as well.
okay, sorry for the venting, but I am glad that I finally figured it out.