Yes, this is similar to what I do with Chritter. In the case of the Twitter API, you can authenticate as a client app. They then redirect you to a page with a PIN, which I read using a content script. Not sure if the Google APIs support the same flow. We should look into whether we can get the Google APIs to accept redirects to "chrome-extensions://" urls.
-Nick On Thu, Aug 20, 2009 at 1:40 PM, Aaron Boodman <[email protected]> wrote: > > Interesting problem... Here is one idea for a solution, there may be > others (note: untested, just brainstorming): > > 1. If you detect you are unauthenticated, open a popup window to the > Google auth URL, with next= pointing to some page on some domain you > control. > > 2. Write a content script that runs on that page, which detects the > success condition and sends the auth token back to the extension. > > 3. Use the auth token. > > Would something like that work? > > - a > > On Thu, Aug 20, 2009 at 6:10 AM, David<[email protected]> wrote: > > > > i've searched this discussion group for anything about using Google's > > different API for various Google services like Google Finance or > > Calendar but didnt seem to find anything > > > > I'm wondering, how can you use Google's JS API inside an extension? I > > tried to put something together that would pull positions from a > > Finance portfolio, but in order to do so, you must authenticate your > > account, which involves redirecting you to site where google can allow > > you to sign in and allow access. > > > > however, this is supposed to redirect you back to the original site > > with your session token, which isn't really possible since the "site" > > is a locally hosted HTML embedded in Chrome. > > > > so when I try to do: > > > > google.accounts.user.login("http://finance.google.com/finance/feeds"); > > > > google says that my "next" parameter is bad (since its something like: > > "file:///aaaaaaaaaa....my_toolstrip.html") which makes sense. > > > > is there a way to get around this so that i can use stored credentials > > (cookies) so a user could go login on Google Finance, and the Chrome > > extension could then use the credentials (or session id/token) that > > Chrome saves? > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en -~----------~----~----~----~------~----~------~--~---
