Authentication without having a browser

1,968 views
Skip to first unread message

Bascy

unread,
Mar 11, 2011, 8:46:14 AM3/11/11
to googlecl...@googlegroups.com
I've just discovered GooglCl and want to use it to upload pictures from my FreeNas netwerk-server to my Google_apps Picasa account
When i run the googlecl script it tells me it cannot locate runnable browser, which is correct as Freenas is a linux based server (stripped FreeBSD) without any client software.

Is there a way to authenticate googleCl without using a browser?
Message has been deleted

Alexander Skwar

unread,
Mar 11, 2011, 8:54:54 AM3/11/11
to googlecl...@googlegroups.com, Bascy
Hi.

You don't have to do the auth on the same system. And IIRC, you
could also use text browsers like lynx, w3m, ... to do the auth.

Alexander
--
↯    Lifestream (Twitter, Blog, …) ↣ http://alexs77.soup.io/     ↯
↯ Chat (Jabber/Google Talk) ↣ a.s...@gmail.com , AIM: alexws77  ↯

Bascy

unread,
Mar 11, 2011, 8:58:05 AM3/11/11
to googlecl...@googlegroups.com, Bascy
So if i authorize on a different system, how do i tell googlecl abou this?
Do i set some config option? transfer a autorisation-file?

Alexander Skwar

unread,
Mar 11, 2011, 9:17:33 AM3/11/11
to googlecl...@googlegroups.com, Bascy
Hi.

On Fri, Mar 11, 2011 at 14:58, Bascy <b...@basbex.com> wrote:
> So if i authorize on a different system, how do i tell googlecl abou this?
> Do i set some config option? transfer a autorisation-file?

Uhm, aren't the instructions printed clear enough? ;)


--($ ~/Src)-- google docs list
Please specify user: a.×××
Please log in and/or grant access at
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4×××&hd=default

Please enter the verification code on the success page:


That's how. Did you not get this?

Bascy

unread,
Mar 11, 2011, 9:20:24 AM3/11/11
to googlecl...@googlegroups.com, Bascy
Nope, my results are:

> docs list
Please specify user: b...@basbex.com
Traceback (most recent call last):
  File "./google", line 478, in run_interactive
    run_once(options, args)
  File "./google", line 605, in run_once
    authenticated = authenticate(auth_manager, options, config, section_header)
  File "./google", line 117, in authenticate
    browser = webbrowser.get()
  File "/usr/local/lib/python2.5/webbrowser.py", line 52, in get
    raise Error("could not locate runnable browser")
Error: could not locate runnable browser

Tom Miller

unread,
Mar 11, 2011, 9:26:26 AM3/11/11
to googlecl...@googlegroups.com

That's not a good response. Could you file a report on the issue tracker?

In the meantime, try setting the auth_browser setting in the configuration file to None. I think that will bypass the check for a browser.

- Tom

Alexander Skwar

unread,
Mar 11, 2011, 9:27:01 AM3/11/11
to googlecl...@googlegroups.com, Bascy
Hi.

Interesting ;)

Well, why don't you install a browser? Comes handy quite
often, I think *G* Doesn't need to be graphical, so w3m,
links or lynx are good enough.

Oh, and of course try what Tom suggested *G*

Bascy

unread,
Mar 11, 2011, 9:36:39 AM3/11/11
to googlecl...@googlegroups.com, Bascy
Its a NAS, so its main task is storing files, and running some processes dedicated to those files. 99.9% of the time this thing runs on its own, with no user involvement. 
So i don't want to install a browser.

Besides, what's the use of a commandline tool if it can't be run on its own because it still requires a browser...

Anyway, i understand from Tom Millers respons that it isnt supposed to work the way it does now on my server.

Alexander Skwar

unread,
Mar 11, 2011, 9:48:39 AM3/11/11
to googlecl...@googlegroups.com, Bascy
Hi.

On Fri, Mar 11, 2011 at 15:36, Bascy <b...@basbex.com> wrote:

> Its a NAS, so its main task is storing files, and running some processes
> dedicated to those files. 99.9% of the time this thing runs on its own, with
> no user involvement.

Well, so? Even on a NAS *I* find it useful to be able to view
stored HTML files, for example. I mean, really, it's not like
w3m/lynx/links are huge - after all, we're talking about a
NAS, so size of programs shouldn't be a matter anyway *G*

> So i don't want to install a browser.

Okay. I don't have to understand everything, do I? *G*

> Besides, what's the use of a commandline tool if it can't be run on its own
> because it still requires a browser...

It doesn't. Just for the auth and even the auth can be done somewhere
else.

> Anyway, i understand from Tom Millers respons that it isnt supposed to work
> the way it does now on my server.

You can of course run google cl on your server. It needs a
"BROWSER", though. If you really don't want to install
a browser (?), then I think the easiest way would be to tell
googlecl (or python, really) to use echo instead. Python
can be told what browser to use by setting the BROWSER
environment variable. Maybe like so:

--($ ~)-- env BROWSER=/bin/echo google docs list
Please specify user:×…
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4×…&hd=default


Please log in and/or grant access at

https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4%2F0B9NVWYtAENc_ZXBdrR9ekm56Dyy&hd=default

Please enter the verification code on the success page:

(That's from Linux. Dunno where your system has an executable
standalone echo)

Regards,

Bascy

unread,
Mar 11, 2011, 9:50:09 AM3/11/11
to googlecl...@googlegroups.com, Bascy
auth_browser=none didnt work.
Registered an issue, nr 375

Alexander Skwar

unread,
Mar 11, 2011, 9:51:05 AM3/11/11
to googlecl...@googlegroups.com, Tom Miller
Hi!

On Fri, Mar 11, 2011 at 15:26, Tom Miller <tom.h....@gmail.com> wrote:

> In the meantime, try setting the auth_browser setting in the configuration
> file to None. I think that will bypass the check for a browser.

That's going to be problematic to do, if he doesn't yet have a
configuration file *G* Of course, he could write one in the
correct syntax manually, but… :)

Gonna repeat what I just wrote — the easiest way in such a
case is to fool googlecl or Python into using something like
"echo" as a browser, eg. like so:

--($ ~)-- env BROWSER=/bin/echo google docs list
Please specify user: ×××
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4×&hd=default


Please log in and/or grant access at
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4×&hd=default

Please enter the verification code on the success page:

And then the user is to go to this google…/…OAuth… URL.

Tom Miller

unread,
Mar 17, 2011, 9:15:39 PM3/17/11
to Alexander Skwar, googlecl...@googlegroups.com
On Fri, Mar 11, 2011 at 9:51 AM, Alexander Skwar <alex...@skwar.name> wrote:
> Hi!
>
> On Fri, Mar 11, 2011 at 15:26, Tom Miller <tom.h....@gmail.com> wrote:
>
>> In the meantime, try setting the auth_browser setting in the configuration
>> file to None. I think that will bypass the check for a browser.
>
> That's going to be problematic to do, if he doesn't yet have a
> configuration file *G* Of course, he could write one in the
> correct syntax manually, but… :)

One of the first things GoogleCL does is generate a config file, so
there (thankfully) won't be a need to do that. And at some stage of
the authentication process, a browser is necessary, though it can be
on a completely different machine. You'll just have to copy the token
file to the appropriate directory. Token files typically reside in
~/.local/share/googlecl

>
> Gonna repeat what I just wrote — the easiest way in such a
> case is to fool googlecl or Python into using something like
> "echo" as a browser, eg. like so:
>
> --($ ~)-- env BROWSER=/bin/echo google docs list
> Please specify user: ×××
> https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4×&hd=default
> Please log in and/or grant access at
> https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4×&hd=default
>
> Please enter the verification code on the success page:

The URL should be printed automatically, whether or not the browser is
launched. So getting this issue resolved should solve the problem as
well.

- Tom

Reply all
Reply to author
Forward
0 new messages