OAuth doesn't work (Invalid Scope)

1,097 views
Skip to first unread message

ComFreek

unread,
Feb 2, 2011, 6:38:34 AM2/2/11
to Chromium-extensions
I have followed these instructions: http://code.google.com/chrome/extensions/tut_oauth.html

My aim is to get the Google Bookmarks by sending a request to "http://
www.google.com/bookmarks/?output=xml&num=10000" so I initialized my
oauth-object as the following:
---
var oauth = ChromeExOAuth.initBackgroundPage({
'request_url':
'https://www.google.com/accounts/OAuthGetRequestToken',
'authorize_url':
'https://www.google.com/accounts/OAuthAuthorizeToken',
'access_url':
'https://www.google.com/accounts/OAuthGetAccessToken',
'consumer_key':
'anonymous',
'consumer_secret':
'anonymous',
'scope': 'http://
www.google.com/bookmarks/',
'app_name': 'blabla'
});
---
In the manifest file I have also granted the permission to call
'http://www.google.com/bookmarks/' but the response of the first
request OAuthGetRequestToken is always "400 Bad Request: Invalid
scope: http://www.google.com/bookmarks/"

Many thanks in advance!
ComFreek

Arne Roomann-Kurrik

unread,
Feb 2, 2011, 12:44:29 PM2/2/11
to ComFreek, Chromium-extensions
That feed uses a cookie for authorization, not OAuth, so I'm not surprised it says invalid scope.  You can't just make up an API and expect it to work ;)

If you issue an XMLHttpRequest from your extension and the user is logged in to Google, you should just get that feed as a response.  No need to use OAuth.

~Arne



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


ComFreek

unread,
Feb 3, 2011, 6:02:50 AM2/3/11
to Chromium-extensions
It works! Many thanks!!
But what should I do if I want to add a bookmark? At this page (http://
www.mmartins.com/mmartins/googlebookmarksapi/) there's explained that
you need a signature key. So there you must operate with OAuth.
But can you tell me how, please?

ComFreek

On 2 Feb., 18:44, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> That feed uses a cookie for authorization, not OAuth, so I'm not surprised
> it says invalid scope.  You can't just make up an API and expect it to work
> ;)
>
> If you issue an XMLHttpRequest from your extension and the user is logged in
> to Google, you should just get that feed as a response.  No need to use
> OAuth.
>
> ~Arne
>
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > .

Arne Roomann-Kurrik

unread,
Feb 3, 2011, 1:28:21 PM2/3/11
to ComFreek, Chromium-extensions
It's not a supported API - that page just describes a bunch of reverse engineered stuff which doesn't look current.

And the page itself says:
    "Neither of the authentication methods recognized by Google (OAuth and AuthSub) apply to Google Bookmarks access."

You apparently need to use some signature variable, but the method they show for obtaining it doesn't appear to work.  Which isn't that surprising considering that the API isn't publicly supported.

It's a shame that they don't have an API because I like the service, but it appears you're out of luck.  Maybe try to find more current information (and then not be surprised if it breaks again in the future)?

~Arne



To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

ComFreek

unread,
Feb 3, 2011, 1:33:35 PM2/3/11
to Chromium-extensions
I understand. So I will search for it and of course I hope they will
publish an API soon.

>>and then not be surprised if it breaks again in the future
Yes ;)

On 3 Feb., 19:28, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> It's not a supported API - that page just describes a bunch of reverse
> engineered stuff which doesn't look current.
>
> And the page itself says:
>     "Neither of the authentication methods recognized by Google (OAuth and
> AuthSub) apply to Google Bookmarks access."
>
> You apparently need to use some signature variable, but the method they show
> for obtaining it doesn't appear to work.  Which isn't that surprising
> considering that the API isn't publicly supported.
>
> It's a shame that they don't have an API because I like the service, but it
> appears you're out of luck.  Maybe try to find more current information (and
> then not be surprised if it breaks again in the future)?
>
> ~Arne
>
> > > > 'http://www.google.com/bookmarks/'butthe response of the first
> > > > request OAuthGetRequestToken is always "400 Bad Request: Invalid
> > > > scope:http://www.google.com/bookmarks/"
>
> > > > Many thanks in advance!
> > > > ComFreek
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Chromium-extensions" group.
> > > > To post to this group, send email to chromium-extensi...@chromium.org.
> > > > To unsubscribe from this group, send email to
> > > > chromium-extensions+unsubscr...@chromium.org<
> > chromium-extensions%2Bunsubscr...@chromium.org>
> > > > .
> > > > For more options, visit this group at
>
> >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org.
Reply all
Reply to author
Forward
0 new messages