Re: Comment on ConsumerHowTo in oauth-php

112 views
Skip to first unread message

oaut...@googlecode.com

unread,
May 31, 2010, 5:58:57 PM5/31/10
to oauth-ph...@googlegroups.com
Comment by satyadeep.1991:

what happens if i dont knw the user id before hand, i know it only after
authorisation??


For more information:
http://code.google.com/p/oauth-php/wiki/ConsumerHowTo

oaut...@googlecode.com

unread,
Jun 10, 2010, 7:24:31 PM6/10/10
to oauth-ph...@googlegroups.com
Comment by styles:

@satyadeep.1991:
I believe the userid is meant to be from your own application/system, and
not one from a service.

oaut...@googlecode.com

unread,
Jun 14, 2010, 6:02:50 AM6/14/10
to oauth-ph...@googlegroups.com
Comment by cezar.elnazli:

How can I change the database driver to MySQLi? Thanks in advance!

oaut...@googlecode.com

unread,
Jun 14, 2010, 11:28:07 AM6/14/10
to oauth-ph...@googlegroups.com
Comment by simon.reekie:

Hello, at r130, some tests are failing for me.

$ php oauth_test.php
...

Assertion failed in
/Users/simonreekie/Tmp/oauth-php-130/test/oauth_test.php:90
$req->getNormalizedParams() == 'a=x%20y&b=x%21y'
...
Assertion failed in
/Users/simonreekie/Tmp/oauth-php-130/test/oauth_test.php:106
$req->signatureBaseString()
== 'POST&https%3A%2F%2Fphotos.example.net%2Frequest_token&oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dhsu94j3884jdopsl%26oauth_signature_method%3DPLAINTEXT%26oauth_timestamp%3D1191242090%26oauth_version%3D1.0'

Anyone else seeing this? This doesn't happen in r98 which I am using
successfully at the moment - but I'd really like to use the version that
supports 1.0a...

oaut...@googlecode.com

unread,
Jun 14, 2010, 3:50:37 PM6/14/10
to oauth-ph...@googlegroups.com
Comment by fiedler....@googlemail.com:

@simon.reekie

Can you file an issue for this in the issues section? I think it will get
lost in this wiki... ;o)

oaut...@googlecode.com

unread,
Jun 14, 2010, 4:02:08 PM6/14/10
to oauth-ph...@googlegroups.com
Comment by fiedler....@googlemail.com:

@simon.reekie

You have to instanciate the Store with MySQLi parameter:

$store = OAuthStore::instance('MySQLi', $options);

oaut...@googlecode.com

unread,
Jun 14, 2010, 4:06:18 PM6/14/10
to oauth-ph...@googlegroups.com
Comment by fiedler....@googlemail.com:

ups... i did mean @cezar.elnazli in my last comment! Sry simon! ;o)

oaut...@googlecode.com

unread,
Jun 15, 2010, 9:55:08 AM6/15/10
to oauth-ph...@googlegroups.com
Comment by simon.reekie:

Np Andre :-) I've filed an issue for the failing tests.

oaut...@googlecode.com

unread,
Jul 22, 2010, 5:52:05 AM7/22/10
to oauth-ph...@googlegroups.com
Comment by simon.re...@gmail.com:

Cross-posted from ServerHowTo, apologies...
--
Hi, I'm trying to get twolegged OAuth to work against my OAuth server. My
first confusion is that in twoleggedtest.php, the url being accessed is
the 'request_token' endpoint:

$key = 'key'; // fill with your public key
$secret = 'secret'; // fill with your secret key
$url = "http://term.ie/oauth/example/request_token.php"; // fill with the
url for the oauth service

Is that correct? Can it not be set directly to
a '$server->verifyIfSigned()' wrapped page on my server?

So when I do change the url in the example to go directly to my page I can
only get that page to work if I call '$server->verifyIfSigned(false)', ie.
a token_type of false.

In this way i'm not able to call the same page in both normal three legged
and two legged!?

Has anyone got this to work? I am quite certain I might be just not
understanding the twolegged use correctly of course :-)

Thanks.

oaut...@googlecode.com

unread,
Aug 2, 2010, 11:15:06 AM8/2/10
to oauth-ph...@googlegroups.com
Comment by polsad:

Hello everyone.

How use xoauth_requestor_id in this library for 2-legged OAuth?
I want to access to
http://www.google.com/calendar/feeds/default/private/full. It is a google
apps calendar, and i must use 2-legged OAuth.

Help me, please!

oaut...@googlecode.com

unread,
Aug 23, 2010, 3:05:31 AM8/23/10
to oauth-ph...@googlegroups.com
Comment by powell.lee:

Hi - I'm attempting to use oauth-php with Googles OAuth API. However, when
it comes to requesting an access token I'm finding the two legged approach
is encoding the token twice, causing malformed tokens and resulting in them
being rejected by Google.

The problem comes here:

$params = array(
'oauth_token' => OAuthRequest::urldecode($_GET['oauth_token']),
'oauth_verifier'=> OAuthRequest::urldecode($_GET['oauth_verifier'])
);

$oauth = new OAuthRequester(ACCESS_URI, 'GET', $params);

When the token is passed into the OAuthRequester constructor, it is passed
to the OAuthRequestSigner constructor, which then sets the parameters and
encodes them.

The problem comes to when the request gets signed on line 131 of
OAuthRequestSigner.php:

$this->setParam('oauth_token', $token);

The token is again set as a parameter causing any encoded characters
(encoded by the constructor) to be re-encoded causing malformed tokens.

oaut...@googlecode.com

unread,
Sep 1, 2010, 11:23:18 PM9/1/10
to oauth-ph...@googlegroups.com
Comment by tdave365:

Before OAuth i Googled "post to twitter using PHP". The first hit gave me
a few lines of code. I copied its 5 or 6 lines, populated $username,
$password, and $message. I ran it. It posted.

This crap here? I have no idea what it's even talking about.

Can anyone point me to 5 or 6 lines of code I can paste to make PHP post to
Twitter now?

oaut...@googlecode.com

unread,
Sep 5, 2010, 4:44:56 PM9/5/10
to oauth-ph...@googlegroups.com
Comment by niwa3836:

tdave365, i am new to all of this and probably starting my code at the
right (or wrong) point. See the API pages of twitter for the
message "August 31, 2010 Basic Auth has been deprecated. All applications
must now use OAuth. Read more »" .... thats why I am here on this page,
maybe you are too! Still cant get it working

oaut...@googlecode.com

unread,
Sep 21, 2010, 3:18:35 AM9/21/10
to oauth-ph...@googlegroups.com
Comment by mvenkatsub:

I really like this library vs. other ones I have found since it has a great
mechanism for storing OAuth credentials. Has anyone out there made a patch
to bring support up to OAuth 1.0a or does anyone know what the status of
this planned support is? Good job on the library in any case.

oaut...@googlecode.com

unread,
Sep 21, 2010, 10:40:24 AM9/21/10
to oauth-ph...@googlegroups.com
Comment by brun...@corollarium.com:

Oauth 1.0a is already supported.

oaut...@googlecode.com

unread,
Sep 22, 2010, 7:38:08 AM9/22/10
to oauth-ph...@googlegroups.com
Comment by mvenkatsub:

Hello,

Thanks for confirming that OAuth 1.0a is already supported. I am trying to
get it implemented in my client but have the following questions:

Referring to this:
http://mojodna.net/2009/05/20/an-idiots-guide-to-oauth-10a.html

1. I am passing oauth_callback as an parameter when I request a request
token.
2. However, I don't get oauth_callback_confirmed=true when the server
responds with a request token. Also, I don't get an oauth_verifier
returned. So how do I request an access token without the oauth_verifier?
The only thing that is returned in the request token are the authorization
uri and the request token itself.

Apologies in advance if I am missing something really obvious.

oaut...@googlecode.com

unread,
Oct 9, 2010, 4:28:01 AM10/9/10
to oauth-ph...@googlegroups.com
Comment by mimearts.2009:

There is no curl here. How do I use the script for twitter?

oaut...@googlecode.com

unread,
Nov 2, 2010, 12:34:49 PM11/2/10
to oauth-ph...@googlegroups.com
Comment by nmaster64:

Warning: Only the server has been updated to 1.0a, the client is still 1.0
and thus does not have working callbacks (the example alone demonstrates
this, as you cannot pass the callback via url parameters anymore, it's part
of the RequestToken phase).

oaut...@googlecode.com

unread,
Nov 4, 2010, 12:30:02 PM11/4/10
to oauth-ph...@googlegroups.com
Comment by nmaster64:

The examples/documentation here is completely wrong for 1.0a use, and I was
convinced the library was incompatible for a long time before I figured out
how it wanted things passed around.

For OAuth 1.0a, you DO NOT pass the callback via url as the current example
shows, but via curl while getting the request token. So in step 3 your call
will become
`$token = OAuthRequester::requestRequestToken($consumer_key, $user_id,
array('oauth_callback' => $callback_uri));`

You must then get the oauth_verifier and include it in the access token
request, like so:
`OAuthRequester::requestAccessToken($consumer_key, $oauth_token,
$user_id, 'POST', $_GET['oauth_verifier']);`

Hope that saves some people the ridiculous amount of time it took me to
realize this.

oaut...@googlecode.com

unread,
Nov 20, 2010, 12:45:03 PM11/20/10
to oauth-ph...@googlegroups.com
Comment by adammineris:

I keep throwing:

CURL error: SSL certificate problem, verify that the CA cert is OK.
Details: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Although, when I visit the API url in chrome, it claims the certificate is
valid (signed by VeriSign), where should I begin to look for issues?

oaut...@googlecode.com

unread,
Nov 25, 2010, 9:54:38 AM11/25/10
to oauth-ph...@googlegroups.com
Comment by arievandenberg:

*oauth-php-super-easy-example.zip*

After spending 3 days testing different libs to get oauth to connect to
Twitter, I setup a (hopefully) very easy example based on andy smith's
implementation (http://oauth.googlecode.com/svn/code/php/). I hope that
this will save others a lot of hours of work to just see it in action.

My goal was to setup a complete example that would *just work* without a
lot of fuss.

It uses CURL to process all outbound calls to Twitter, so make sure your OS
has it installed. Tested with php v5.3.3. Make sure you open up both
client.php and common.inc.php and change the include paths as needed.

*oauth-php-super-easy-example.zip*
https://docs.google.com/leaf?id=0B0FXNCj3-C0AYjgwYWQzY2YtN2VjYi00N2Y1LWJkNjQtM2I0ODBiZDU3MTI5&hl=en

oaut...@googlecode.com

unread,
Nov 25, 2010, 9:58:41 AM11/25/10
to oauth-ph...@googlegroups.com
Comment by arievandenberg:

oauth-php-super-easy-example.zip

After spending 3 days testing different libs to get oauth to connect to
Twitter, I setup a (hopefully) very easy example based on andy smith's
implementation (http://oauth.googlecode.com/svn/code/php/). I hope that
this will save others a lot of hours of work to just see it in action.

My goal was to setup a complete example that would *just work* without a
lot of fuss.

It uses CURL to process all outbound calls to Twitter, so make sure your OS
has it installed. Tested with php v5.3.3. Make sure you open up both
client.php and common.inc.php and change the include paths as needed.

get it here:

oaut...@googlecode.com

unread,
Dec 31, 2010, 12:32:58 AM12/31/10
to oauth-ph...@googlegroups.com
Comment by willowdan:

Hi Arievanderberg,

I believe your script is for web client, do you have one for pin-based
server client?

Thanks

oaut...@googlecode.com

unread,
Jan 6, 2011, 1:58:43 AM1/6/11
to oauth-ph...@googlegroups.com
Comment by sonawane.sagar:

@ arievandenberg : i am getting following error in you clinet.php code

"SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed"

when i print curl_error for "request_token" action..

Also, im getting same error for oauth-php\example\twoleggedtwitter.php

I m running code from my localhost but i have made host entry for the
callback domain(of callback url) that i have registered with Twitter and
passing same consumer key and consumer secret that twitter gave me upon
registration of app.

Am i doing something wrong over here..why is this error..??

please help

oaut...@googlecode.com

unread,
Jan 6, 2011, 3:25:36 AM1/6/11
to oauth-ph...@googlegroups.com
Comment by sonawane.sagar:

Ok i have resolved that issue.related curl and ssl thingy

oaut...@googlecode.com

unread,
Jan 13, 2011, 10:19:13 PM1/13/11
to oauth-ph...@googlegroups.com
Comment by stalker...@gmail.com:

Is there any way to do the 3-legged without setting up a MySQL database and
just using some temp memory for the store?

oaut...@googlecode.com

unread,
Feb 9, 2011, 1:04:05 AM2/9/11
to oauth-ph...@googlegroups.com
Comment by hemerson...@gmail.com:

Hi.

I'm using the library oauth-php for use this API:
http://developer.trademe.co.nz/

I have connected, also got the access token and got information through API.

But now I need to send information to API, I need to send a XML String for
web request.

With oauth-php I can do it?
Can I use OAuthRequester method to send the XML via web request?

Somebody can show me an example how I can send XML with OAuthRequester?

URL:
https://api.trademe.co.nz/{version}/Listings/{listing_id}/questions/{question_id}/answerquestion.{file_format}

XML:
<code><ListingAnswerQuestion xmlns="http://api.trademe.co.nz/v1">
<answer>Yes it does blend.</answer>
</ListingAnswerQuestion>
</code>

Link Method:
http://developer.trademe.co.nz/api-documentation/listing-methods/answer-question/

Kind regards.

Hemerson.

oaut...@googlecode.com

unread,
Mar 9, 2011, 9:19:41 AM3/9/11
to oauth-ph...@googlegroups.com
Comment by harna...@students.lgu.edu.lb:

Hello :)

I implemented the same code as given in the example, however im getting
this error after the first register goes fine, the second time I run the
code it gives this:

Fatal error: Uncaught exception 'OAuthException2' with message 'The server
with key "students.lgu.edu.lb" has already been registered' in
/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/lib/store/OAuthStoreSQL.php:782
Stack trace: #0
/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/index.php(19):
OAuthStoreSQL->updateServer(Array, '1') #1 {main} thrown in
/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/lib/store/OAuthStoreSQL.php
on line 782

If I run the code the first time I get a different error, which is this:

OAuthException: No server with consumer_key "students.lgu.edu.lb" has been
registered (for this user)object(OAuthException2)#2 (7) {
["message":protected]=> string(85) "No server with
consumer_key "students.lgu.edu.lb" has been registered (for this user)"
["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0)
["file":protected]=>
string(85) "/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/lib/store/OAuthStoreSQL.php"
["line":protected]=> int(453) ["trace":"Exception":private]=> array(2) {
[0]=> array(6) { ["file"]=>
string(80) "/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/lib/OAuthRequester.php"
["line"]=> int(155) ["function"]=> string(9) "getServer" ["class"]=>
string(13) "OAuthStoreSQL" ["type"]=> string(2) "->" ["args"]=> array(2) {
[0]=> string(19) "students.lgu.edu.lb" [1]=> int(0) } } [1]=> array(6) {
["file"]=>
string(67) "/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/index.php"
["line"]=> int(25) ["function"]=> string(19) "requestRequestToken"
["class"]=> string(14) "OAuthRequester" ["type"]=> string(2) "::"
["args"]=> array(3) { [0]=> string(19) "students.lgu.edu.lb" [1]=> int(0)
[2]=> array(3) { ["scope"]=> string(29) "http://docs.google.com/feeds/"
["xoauth_displayname"]=> string(12) "LGU Students" ["oauth_callback"]=>
string(13) "ManageAccount" } } } } ["previous":"Exception":private]=> NULL }


I really need help in applying a MySQL storage rather than the Session one,
though I dont have problems in implementing the Session storage, works like
a charm.

I Appreciate the help

oaut...@googlecode.com

unread,
Mar 9, 2011, 9:23:42 AM3/9/11
to oauth-ph...@googlegroups.com
Comment by harna...@students.lgu.edu.lb:

Hello :)

I implemented the same code as given in the example, however im getting
this error after the first register goes fine, the second time I run the
code it gives this:


Fatal error: Uncaught exception 'OAuthException2' with message 'Unexpected
result from the
server "https://www.google.com/accounts/OAuthGetRequestToken" (400) while
requesting a request token' in
/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/lib/OAuthRequester.php:169
Stack trace: #0
/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/index.php(21):
OAuthRequester::requestRequestToken('students.lgu.ed...', '1') #1 {main}
thrown in
/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/lib/OAuthRequester.php
on line 169


I really need help in applying a MySQL storage rather than the Session one,
though I dont have problems in implementing the Session storage, works like
a charm.

I Appreciate the help

Hisham

oaut...@googlecode.com

unread,
Mar 9, 2011, 9:43:57 AM3/9/11
to oauth-ph...@googlegroups.com
Comment by harna...@students.lgu.edu.lb:

So I managed to make it work, but after it registers the consumer key in
the db, i started to get this error, which doesn't go until I delete the
value from the database:

Fatal error: Uncaught exception 'OAuthException2' with message 'The server
with key "domain.com" has already been registered' in

/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/lib/store/OAuthStoreSQL.php:782
Stack trace: #0
/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/index.php(19):

OAuthStoreSQL->updateServer(Array, '1') #1 {main} thrown in
/home/hisham-a/public_html/x/newsys/files/gmail/apigoogle/lib/store/OAuthStoreSQL.php
on line 782

how is it supposed to work ?

regards,

hisham

Sergey Chernyshev

unread,
Mar 9, 2011, 11:00:54 AM3/9/11
to oauth-ph...@googlegroups.com, oaut...@googlecode.com
Those seem to be separate steps - first step is to register a server with key in the system - it happens when admin of the account in your system specifies the API key.

This can actually be you - the admin of the whole system if the key for connecting with the server is the same for all users. You'll need to skip user_id in the call like this:
$consumer_key = $store->updateServer($server);
and have 'user_id' => 'null' defined in the $server array.

The only problem is that in current code, there is a bug having global keys like that - see bug tracker:

You can try applying the patch I submitted to that bug though ;)

So, after you done with this step - the rest of the calls for that consumer_key do not need the updateServer calls.

         Sergey

oaut...@googlecode.com

unread,
Apr 6, 2011, 8:08:16 AM4/6/11
to oauth-ph...@googlegroups.com
Comment by ulasari...@gmail.com:

Hi. I have to get access for 2 or more APIs. I changed the googledocs.php
example file like;

$getAuthTokenParams = array('scope' =>
'http://docs.google.com/feeds/ http://www.google.com/calendar/feeds/
http://www.google.com/m8/feeds/',
'xoauth_displayname' => 'xxx',
'oauth_callback' => 'http://xxx/googledocs.php');


$request = new
OAuthRequester("http://docs.google.com/feeds/default/private/full/", 'GET',
$tokenResultParams);


The grant access page is working well I got the token. But when it returns
back to googledocs.php again, it gives me:

Request failed with code 400: Invalid request URIobject(OAuthException2)#4
(7) { ["message":protected]=> string(49) "Request failed with code 400:
Invalid request URI"

I also tried to fetch data with only one API access. There was no problem.
Can you please help me?

oaut...@googlecode.com

unread,
Apr 13, 2011, 7:41:32 PM4/13/11
to oauth-ph...@googlegroups.com
Comment by channelv...@gmail.com:

RE: You always need to initialize the OAuthStore before you can start using
the OAuth library.

Can someone provide an example of what needs to be done here? I have the
MySql database created and I'm looking for sample/example code to run as a
next step. Thanks

oaut...@googlecode.com

unread,
Apr 16, 2011, 11:36:48 AM4/16/11
to oauth-ph...@googlegroups.com
Comment by theorigi...@gmail.com:

running oauth-example.php and getting 500 error which states "no server
with consumer key xxxx has been registered". Do I need to enter this info
outside the program? Or is some other function failing (no other errors
reported; sql logs are clean too.

oaut...@googlecode.com

unread,
May 13, 2011, 3:46:17 PM5/13/11
to oauth-ph...@googlegroups.com
Comment by pdar...@gmail.com:

I've encountered and gotten past a number of errors, but I'm stuck on this
one:

Fatal error: Uncaught exception 'OAuthException2' with message 'The server

with key xxxx has already been registered' in
C:\xampp\htdocs\oauth-php\library\store\OAuthStoreSQL.php:782 Stack trace:
#0 C:\xampp\htdocs\oauth-php\example\client\fitbitoauth.php(27):
OAuthStoreSQL->updateServer(Array, 1) #1 {main} thrown in
C:\xampp\htdocs\oauth-php\library\store\OAuthStoreSQL.php on line 782

Any suggestions anyone?

oaut...@googlecode.com

unread,
Jun 1, 2011, 12:22:11 AM6/1/11
to oauth-ph...@googlegroups.com
Comment by vin...@dakinegroup.com:

i could get it to work finally, took few hours. It might be a good idea to
refer to the sample program lying in the oauth-php that one can use to test
concepts.

Those who are trying it for the first time, please note that there are
nuances specific to versions of oauth and additional parameters required by
different service providers. Nevertheless, the library provides optional
arguments to deal with it.Refer to Comment by nmaste...@gmail.com, Nov 4,
2010 above for one such change. I have tried google, yahoo and here are key
diffferences that i could see till now:

Google:
a request token from the server. You would require optional argument to
provide scope parameter for google


$token = OAuthRequester::requestRequestToken($consumer_key, $user_id,

array('scope' => "https://www.google.com/m8/feeds/contacts/default/full/"));

Yahoo


$token = OAuthRequester::requestRequestToken($consumer_key, $user_id,

array('oauth_callback' => 'http://netucation.co.in/ef'));

I am exploring:
when server allows user to authenticate with google, how to get
this "userid" in case of multiple such users coming to my server. There
would be cases, who won't complete the authentication and leave it in
between. Example quoted here requires userid at the begining, when our
program does not know whether the user is a new one or an existing one or
whether he/she would complete authentication (ghost).
Have couple of threads, will update more when i conclude.

oaut...@googlecode.com

unread,
Jun 29, 2011, 1:41:04 PM6/29/11
to oauth-ph...@googlegroups.com
Comment by ferret1...@gmail.com:

Hi, Would appreciate help on this one.
I am working in a situation where I have to use this oauth library, and the
access token is stored in custom table (it has to be like this) rather than
the default ones using OauthStoreMysql. I am using OauthStoreSession to get
the access token and save it to my database.

I am having problems doing the final part of oauth, getting user info. Is
there a way I can plug in the access tokens I already have into this code
and send it off to retrieve user info?
Im trying it on twitters api.twitter.com/1/account/verify_credentials.json
at the moment.

Basically I already have an access token stored in a string, and I want to
get user info!

Thanks in advance!

oaut...@googlecode.com

unread,
Jul 9, 2011, 10:10:24 AM7/9/11
to oauth-ph...@googlegroups.com
Comment by necro...@googlemail.com:

When using three legged oauth it is important that you do not include
oauth-php/library/OAuthRequester.php before you have stored the new server.

It would be nice if you also mentioned that you have to import
oauth-php/library/store/mysql/mysql.sql before creating the server.

oaut...@googlecode.com

unread,
Aug 5, 2011, 3:26:58 PM8/5/11
to oauth-ph...@googlegroups.com
Comment by alexla...@gmail.com:

Hi everyone,

I'm really new to this stuff and going through the process as best I can, I
feel like I have general grasp on things but I can't figure out Step 1. I'm
not sure if it's my database settings or what, but I basically copy what is
shown in the code snippet and replace everything with my data, but never
see the echo I have after it and get an Internal Server Error (500) on the
page. Can someone help me out or give me some things to check to try to get
this working?

Thanks in advance!

oaut...@googlecode.com

unread,
Sep 10, 2011, 11:35:01 AM9/10/11
to oauth-ph...@googlegroups.com
Comment by matteopa...@gmail.com:

is PUT supported?

oaut...@googlecode.com

unread,
Oct 3, 2011, 8:33:38 AM10/3/11
to oauth-ph...@googlegroups.com
Comment by lokegu...@gmail.com:

Can I use same library for facebook and other provider as well?

oaut...@googlecode.com

unread,
Feb 5, 2012, 8:54:56 AM2/5/12
to oauth-ph...@googlegroups.com
Comment by andre.la...@gmail.com:

I have checked the included examples for twitter and GDocs OAuth and found
some minor issues which I want to list for all who are interested (partly
already discussed in the Issue Tracker section):

- twitter 2-legged oauth doesn't seem to work any longer for querying
Twitters public_timeline.json, Twitter states here that not more than XXX
anonymous requests per day are allowed. However, the 3-legged oauth version
(with authentication) works for me. You only have to pay attention that you
do not include additional $getAuthTokenParams in the requestRequestToken
step (as e.g. in the GDocs example), otherwise the Twitter API call will
fail

- If you use the 3-legged GDocs example together with a MySQL Store, the
server_uri for the OAuth Store initialization must match the API domain you
want to query later. In the example, https://google.com is used instead of
https://docs.google.com/feeds/. As a result, no access tokes will be found
within the Store although the OAuth Handshake worked fine.

- If you use a MySQL OAuth Store, the $store->updateServer() call will
always raise an exception if you load the page for the second time (e.g
after OAuth authentication redirects the user back to your application
webpage). I wrapped a try catch block around it which suppresses the
warning. With that, everything works fine.

- If you use a Session Store (by default), pay attention to clear the old
OAuth _SESSION content before starting a new OAuth Handshake. I had
problems doing consecutive OAuthentication for multiple applications within
one browser session.

Nevertheless, oauth-php is a great library!

André

oaut...@googlecode.com

unread,
Apr 24, 2012, 6:53:11 AM4/24/12
to oauth-ph...@googlegroups.com
Comment by plokoonm...@gmail.com:

Hi,
To make signed requests having already stored the access token and secret,
you just need to do this:

$store = OAuthStore::instance('Session', $server); //server description
$store->addServerToken($CONSUMER_KEY, $token_type, $ACCESS_TOKEN,
$ACCESS_TOKEN_SECRET, $user, $options=array());

Hope this will be useful for somebody :)

oaut...@googlecode.com

unread,
Jul 3, 2012, 11:43:14 AM7/3/12
to oauth-ph...@googlegroups.com

oaut...@googlecode.com

unread,
Jul 23, 2012, 10:34:25 AM7/23/12
to oauth-ph...@googlegroups.com
Comment by shinut...@gmail.com:

Where i can find the server code?

oaut...@googlecode.com

unread,
Jul 26, 2012, 6:45:09 PM7/26/12
to oauth-ph...@googlegroups.com
Comment by aron...@gmail.com:

The OAuthStorePDO has two calls to mbstring functions, so to use that you
either have to have that extension installed (its not default) or you have
to go in and wrap them in a function exists call. They are on line 218 and
230. Looks like the developers did this in the OAuthRequest class, but not
for the pdo store.

oaut...@googlecode.com

unread,
Sep 11, 2012, 10:22:47 AM9/11/12
to oauth-ph...@googlegroups.com
Comment by sibzt...@gmail.com:

Hi! This is a real raw Noob question but I hope there will be some one to
help us. We are building an app that allows users to call a number and
dictate a tweet. We then need to POst the tweet to the users twitter
account. We have completed the Voice to Text functions and have also used
OAuth to post the tweets. But we have to ask the users to save their
Consumer key, Consumer Secrete, Access Token and Access Token Secret.
Is there any way where we can avoid these details? Cant we use a single
consumer key, etc and allow all users to post to their respective accounts
using this common key?
Any help in this matter will be really helpful. Or if we need to post this
question in any other page please let us know that.
thanx.

oaut...@googlecode.com

unread,
Nov 9, 2012, 7:46:29 PM11/9/12
to oauth-ph...@googlegroups.com
Comment by TynorHFu...@gmail.com:

Hello! I am trying to use this library for a rather tricky client/server
relationship that requires oauth, and I'm wondering how to send post
bodies, instead of just retrieving resources.
It doesn't seem like this wiki is very active but if someone gets a chance
to response, that would be wonderful!

oaut...@googlecode.com

unread,
Apr 25, 2013, 3:00:57 AM4/25/13
to oauth-ph...@googlegroups.com
Comment by adilk2...@gmail.com:

Hi, I don't know if the comments are still being viewed by anyone at
google, but I had to make some changes to the code given here to make it
work.

Before you respond, I know it's not a good idea to modify code that someone
like Google gives you. This is why i'm making a comment here.

1- The server side of the code sample you gave is using the post method &
the consumer side is using the get method; I'm talking about the sample
code you have provided above on this page.

There are other small changes like the one above which I had to make.
Please don't misunderstand me. The code is really helpful but i'm confused
as to whether the changes I made were necessary or I am using your library
improperly.

Comments from all are welcomed.

oaut...@googlecode.com

unread,
Apr 25, 2013, 3:11:41 AM4/25/13
to oauth-ph...@googlegroups.com
Comment by TalksOn...@gmail.com:

oaut...@googlecode.com

unread,
Apr 25, 2013, 3:48:38 AM4/25/13
to oauth-ph...@googlegroups.com
Comment by ma...@pobox.com:

This code is not made by Google. The first version was made available by
Mediamatic Lab in The Netherlands.

Bruno volunteered to maintain the code when we (Marc et al) didn't have
time to maintain it anymore. Bruno did an excellent job!

Please provide detailed changes you had to make in an issue - then we can
make the changes. Thanks!

oaut...@googlecode.com

unread,
Apr 25, 2013, 8:23:45 PM4/25/13
to oauth-ph...@googlegroups.com
Comment by TalksOn...@gmail.com:

@project_member I was using it wrong. I had some mixed concept. Thanks
anyway

oaut...@googlecode.com

unread,
May 30, 2013, 5:43:47 AM5/30/13
to oauth-ph...@googlegroups.com
Comment by himashu....@sourcebits.com:

Hi, I have successfully got access tokens, but i dont know how to call my
api's using thar access tokens.Please help !!

oaut...@googlecode.com

unread,
May 30, 2013, 5:46:17 AM5/30/13
to oauth-ph...@googlegroups.com
Comment by himanshu...@gmail.com:

Hi, I have got access tokens successfully. Can anyone please tell me how
can i proceed further using these access tokens ?

oaut...@googlecode.com

unread,
Dec 1, 2013, 2:45:01 PM12/1/13
to oauth-ph...@googlegroups.com

oaut...@googlecode.com

unread,
Dec 9, 2013, 2:33:00 AM12/9/13
to oauth-ph...@googlegroups.com
Comment by s...@4acetech.com:

aaaaaaaa

oaut...@googlecode.com

unread,
Feb 10, 2014, 9:06:40 PM2/10/14
to oauth-ph...@googlegroups.com
Comment by seradjhu...@gmail.com:

very interesting article. now i know how to use this access token and the
following steps. please continue posting i'm looking for more updates .

thank you

<a href="http://buildmyfollowers.org/buy-twitter-favorites/">buy Twitter
favorites</a>

oaut...@googlecode.com

unread,
Mar 3, 2014, 6:29:31 AM3/3/14
to oauth-ph...@googlegroups.com
Comment by ni...@unitedinfotech.in:

Fatal error: Uncaught exception 'OAuthException2' with message 'Could not
find a "request" token for
consumer "29243ab288aedc8325a2828ca7a633e5053145c78" and user 1' in

oaut...@googlecode.com

unread,
Mar 3, 2014, 6:31:43 AM3/3/14
to oauth-ph...@googlegroups.com
Comment by ni...@unitedinfotech.in:

Fatal error: Uncaught exception 'OAuthException2' with message 'Could not
find a "request" token for
consumer "29243ab288aedc8325a2828ca7a633e5053145c78" and user 1' in

while exchanging token , as define in Step 4 Request Token For Access Token

oaut...@googlecode.com

unread,
Mar 10, 2014, 3:45:56 AM3/10/14
to oauth-ph...@googlegroups.com
Comment by ni...@unitedinfotech.in:

What should I do to execute successfully execute 3-legged example ?

oaut...@googlecode.com

unread,
May 5, 2014, 8:08:16 AM5/5/14
to oauth-ph...@googlegroups.com
Comment by rajaselv...@gmail.com:

Hi ..I created one new shopify app, now i want some add php code for
download customer details. i dont know which is the correct place and what
php code to add.Can you help me?.. Thanks in advance.
Reply all
Reply to author
Forward
0 new messages