The work-around is to redirect to a trusted page (such as your personal website) and use the tab API to parse the token from the url.
-Nick 2009/12/1 Riccardo Govoni ☢ <[email protected]> > Hi all, > I'd like to write an extension that talks to some Google services via GData > API. > I'm looking at this doc ( > http://code.google.com/apis/gdata/docs/js-authsub.html ) about how to > authenticate via JS. > > However, if I try some basic authentication ( like this one: > > http://gdatatips.blogspot.com/2008/12/using-javascript-client-library-w-non.html > ) directly in my extension code, I'm not able to login. > > The problem is the redirect from the Google login page back to my > extension. Since the browser is redirected back to an URL which looks > like chrome-extesion://foobar/mypage.html#auth_token , Chromium raises > error 311 (net::ERR_UNSAFE_REDIRECT). I guess that means that webpages > cannot redirect directly to extension code (for safety reasons). > > Is there a way around that? > > The only solution I can think of is to create a proxy: deploy a > regular webpage (with js authentication code) somewhere and then use a > content script to talk to that page ( > > http://code.google.com/chrome/extensions/content_scripts.html#host-page-communication > ). Sounds a bit of a pain. > > /R. > > -- > > 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]<chromium-extensions%[email protected]> > . > For more options, visit this group at > http://groups.google.com/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 [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.
