You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Harris Wong <ha...@utoronto.ca> on 2010/04/28 19:48:34 UTC
OAuth - Invalid Token
Hi,
I am having a problem with OAuth token authentication, a similar problem
to
http://groups.google.com/group/partuza/browse_thread/thread/7b4bea940d386119,
but not sure what the solution is. This is what I did,
1. I added the Google OAuth-Contact gadget to my local container
(http://gadget-doc-examples.googlecode.com/svn/trunk/opensocial-gadgets/oauth-contacts.xml).
2. I added the following to my shindig/config/oauth.json
"http://gadget-doc-examples.googlecode.com/svn/trunk/opensocial-gadgets/oauth-contacts.xml": {
"google" : {
"consumer_key" : "consumer_key",
"consumer_secret" : "consumer_secret",
"key_type" : "HMAC_SYMMETRIC"
}
}
3. I went into the gadget page, I was able to see:
OAuth Contacts:
Personalize this gadget
4. I clicked on the "Personalize this gadget" link, it redirects me to
Google for authentication. However, I got the following:
Invalid Token.
The link for the Google authentication page is:
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_callback=http://oauth.gmodules.com/gadgets/oauthcallback?oauth_token=
Notice how the "oauth_token" is empty. From the post by Chris, this
behavior was supposed to be correct. Though, I am not sure why I am
getting an Invalid Token error.. Any help is appreciated!
Thanks,
Harris
--
Harris Wong
Accessible Software Developer
Adaptive Technology Resource Centre, University of Toronto
130 St. George Street
Toronto, ON, M5S 1A5
Re: OAuth - Invalid Token
Posted by Harris Wong <ha...@utoronto.ca>.
Hi,
I backtraced to shindig/php/src/gadgets/oauth/OAuthFetcher.php; line
395~396. Found the problem, "Consumer is not registered:
consumer_key". I guess I will have to use my own end points.
Here is the backtrace as a reference:
|RemoteContentRequest Object
||(
|| [uri:private] => https://www.google.com/accounts/OAuthGetRequestToken?scope=http://www.google.com||/m8/feeds/
|| [notSignedUri:private] => https://www.google.com/accounts/OAuthGetRequestToken?scope=http://www.google||.com/m8/feeds/
|| [method:private] => GET
|| [headers:private] => Authorization:OAuth oauth_nonce="b1a5894da415dd4dc676aff65b071b1f", oauth_timestamp||="1272485628", oauth_consumer_key="consumer_key", xoauth_app_url="http%253A%252F%252Fgadget-doc-examples||.googlecode.com%252Fsvn%252Ftrunk%252Fopensocial-gadgets%252Foauth-contacts.xml", oauth_signature_method||="HMAC-SHA1", oauth_signature="dtRIxqjVwEFkJcCBLFoxnXJmDP8%3D"
||
|| [postBody:private] =>
|| [responseContent:private] => Consumer is not registered: consumer_key
||
||
|| [responseSize:private] => 42
|| [responseHeaders:private] => HTTP/1.1 400 Bad Request
||Content-Type: text/plain; charset=UTF-8
||Date: Wed, 28 Apr 2010 20:13:33 GMT
||Expires: Wed, 28 Apr 2010 20:13:33 GMT
||Cache-Control: private, max-age=0
||X-Content-Type-Options: nosniff
||X-XSS-Protection: 1; mode=block
||Content-Length: 42
||Server: GSE
|| [httpCode:private] => 400
|| [contentType:private] => text/plain; charset=UTF-8
|| [options:private] => Options Object
|| (
|| [ignoreCache] =>
|| [ownerSigned] => 1
|| [viewerSigned] => 1
|| )
||
|| [created:private] => 1272485628
||)
|
On 28/04/2010 1:48 PM, Harris Wong wrote:
> Hi,
>
> I am having a problem with OAuth token authentication, a similar
> problem to
> http://groups.google.com/group/partuza/browse_thread/thread/7b4bea940d386119,
> but not sure what the solution is. This is what I did,
>
> 1. I added the Google OAuth-Contact gadget to my local container
> (http://gadget-doc-examples.googlecode.com/svn/trunk/opensocial-gadgets/oauth-contacts.xml).
>
>
> 2. I added the following to my shindig/config/oauth.json
> "http://gadget-doc-examples.googlecode.com/svn/trunk/opensocial-gadgets/oauth-contacts.xml":
> {
> "google" : {
> "consumer_key" : "consumer_key",
> "consumer_secret" : "consumer_secret",
> "key_type" : "HMAC_SYMMETRIC"
> }
> }
>
> 3. I went into the gadget page, I was able to see:
> OAuth Contacts:
> Personalize this gadget
>
> 4. I clicked on the "Personalize this gadget" link, it redirects me
> to Google for authentication. However, I got the following:
> Invalid Token.
>
> The link for the Google authentication page is:
> https://www.google.com/accounts/OAuthAuthorizeToken?oauth_callback=http://oauth.gmodules.com/gadgets/oauthcallback?oauth_token=
>
>
> Notice how the "oauth_token" is empty. From the post by Chris, this
> behavior was supposed to be correct. Though, I am not sure why I am
> getting an Invalid Token error.. Any help is appreciated!
>
>
> Thanks,
> Harris
>
--
Harris Wong
Accessible Software Developer
Adaptive Technology Resource Centre, University of Toronto
130 St. George Street
Toronto, ON, M5S 1A5