FAQ
Dear list,

I'm trying to use google-api-go-client for batch upload files to Google
Drive. When reading the example code I found that in function openUrl() it
calls up external browser. Is this the only way to do the oauth client
authorization?

Usually it's not a problem, but what I'm trying to write is a command line
tool ideally running on my headless home NAS.

Thanks
Andy

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Kyle Lemons at Aug 31, 2013 at 12:39 am
    You will have to get the token somehow. You can echo the auth URL to a
    console, have someone click it, and set the redirect URL to the NAS for
    instance.

    On Fri, Aug 30, 2013 at 1:11 AM, Andy W. Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to Google
    Drive. When reading the example code I found that in function openUrl() it
    calls up external browser. Is this the only way to do the oauth client
    authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andy W. Song at Aug 31, 2013 at 3:06 am
    I understand that I have to get the token somehow.

    But can it be like, say the GAE uploader, you input your credentials from
    command line and get authorized?

    What I don't want is to have to involve GUI in anyway because that prevents
    me from doing it automatically.

    On Sat, Aug 31, 2013 at 8:38 AM, Kyle Lemons wrote:

    You will have to get the token somehow. You can echo the auth URL to a
    console, have someone click it, and set the redirect URL to the NAS for
    instance.

    On Fri, Aug 30, 2013 at 1:11 AM, Andy W. Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to Google
    Drive. When reading the example code I found that in function openUrl() it
    calls up external browser. Is this the only way to do the oauth client
    authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kyle Lemons at Aug 31, 2013 at 4:27 am
    You will have to involve a GUI somehow, regardless of how you do the
    authentication; there is no way (of which I am aware) that lets you use a
    username and password. Even appcfg.py has an --oauth2 flag that uses the
    new oauth method. Perhaps what you're looking for is the device
    flow<https://developers.google.com/accounts/docs/OAuth2ForDevices>,
    which reverses it a bit: it gives you a URL and a token. The user
    navigates to that URL, logs in, and enters the token. At that point, the
    token you've received from the device flow can be used to authenticate as
    that user (modulo the usual refresh dance when it expires). You should
    only have to do this once every 30 days, if I recall.

    On Fri, Aug 30, 2013 at 8:05 PM, Andy W. Song wrote:

    I understand that I have to get the token somehow.

    But can it be like, say the GAE uploader, you input your credentials from
    command line and get authorized?

    What I don't want is to have to involve GUI in anyway because that
    prevents me from doing it automatically.

    On Sat, Aug 31, 2013 at 8:38 AM, Kyle Lemons wrote:

    You will have to get the token somehow. You can echo the auth URL to a
    console, have someone click it, and set the redirect URL to the NAS for
    instance.

    On Fri, Aug 30, 2013 at 1:11 AM, Andy W. Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to Google
    Drive. When reading the example code I found that in function openUrl() it
    calls up external browser. Is this the only way to do the oauth client
    authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kyle Lemons at Aug 31, 2013 at 4:38 am
    Actually, there are also service
    accounts<https://developers.google.com/accounts/docs/OAuth2ServiceAccount>...
    I thought those were just an appengine thing, but the documentation doesn't
    seem to imply that. There is an implementation of
    jwt<http://godoc.org/code.google.com/p/goauth2/oauth/jwt>in the
    goauth2 project.

    On Fri, Aug 30, 2013 at 9:26 PM, Kyle Lemons wrote:

    You will have to involve a GUI somehow, regardless of how you do the
    authentication; there is no way (of which I am aware) that lets you use a
    username and password. Even appcfg.py has an --oauth2 flag that uses the
    new oauth method. Perhaps what you're looking for is the device flow<https://developers.google.com/accounts/docs/OAuth2ForDevices>,
    which reverses it a bit: it gives you a URL and a token. The user
    navigates to that URL, logs in, and enters the token. At that point, the
    token you've received from the device flow can be used to authenticate as
    that user (modulo the usual refresh dance when it expires). You should
    only have to do this once every 30 days, if I recall.

    On Fri, Aug 30, 2013 at 8:05 PM, Andy W. Song wrote:

    I understand that I have to get the token somehow.

    But can it be like, say the GAE uploader, you input your credentials from
    command line and get authorized?

    What I don't want is to have to involve GUI in anyway because that
    prevents me from doing it automatically.

    On Sat, Aug 31, 2013 at 8:38 AM, Kyle Lemons wrote:

    You will have to get the token somehow. You can echo the auth URL to a
    console, have someone click it, and set the redirect URL to the NAS for
    instance.

    On Fri, Aug 30, 2013 at 1:11 AM, Andy W. Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to Google
    Drive. When reading the example code I found that in function openUrl() it
    calls up external browser. Is this the only way to do the oauth client
    authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andy W. Song at Aug 31, 2013 at 1:44 pm
    Thanks for pointing it out. Now I see that except the service accounts
    approach there really is no way to get around browser.

    But I really don't see the point. Why is a browser treated more trustable
    than my client app? The end user can use any browser, right? Why can't
    goole let my client app take the end user's credentials and pass it to
    google oauth server to obtain the token?

    On Sat, Aug 31, 2013 at 12:37 PM, Kyle Lemons wrote:

    Actually, there are also service accounts<https://developers.google.com/accounts/docs/OAuth2ServiceAccount>...
    I thought those were just an appengine thing, but the documentation doesn't
    seem to imply that. There is an implementation of jwt<http://godoc.org/code.google.com/p/goauth2/oauth/jwt>in the goauth2 project.

    On Fri, Aug 30, 2013 at 9:26 PM, Kyle Lemons wrote:

    You will have to involve a GUI somehow, regardless of how you do the
    authentication; there is no way (of which I am aware) that lets you use a
    username and password. Even appcfg.py has an --oauth2 flag that uses the
    new oauth method. Perhaps what you're looking for is the device flow<https://developers.google.com/accounts/docs/OAuth2ForDevices>,
    which reverses it a bit: it gives you a URL and a token. The user
    navigates to that URL, logs in, and enters the token. At that point, the
    token you've received from the device flow can be used to authenticate as
    that user (modulo the usual refresh dance when it expires). You should
    only have to do this once every 30 days, if I recall.

    On Fri, Aug 30, 2013 at 8:05 PM, Andy W. Song wrote:

    I understand that I have to get the token somehow.

    But can it be like, say the GAE uploader, you input your credentials
    from command line and get authorized?

    What I don't want is to have to involve GUI in anyway because that
    prevents me from doing it automatically.

    On Sat, Aug 31, 2013 at 8:38 AM, Kyle Lemons wrote:

    You will have to get the token somehow. You can echo the auth URL to a
    console, have someone click it, and set the redirect URL to the NAS for
    instance.

    On Fri, Aug 30, 2013 at 1:11 AM, Andy W. Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to
    Google Drive. When reading the example code I found that in
    function openUrl() it calls up external browser. Is this the only way to do
    the oauth client authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kyle Lemons at Aug 31, 2013 at 3:53 pm
    That's not a question I can really answer, but I suspect it has to do with
    the fact that Google would prefer that you don't need to know the user's
    credentials :). The more place a user's credentials are stored, the less
    secure the user's account. OAuth tokens can be individually revoked, as
    well. Consider also that some users will have 2-factor authentication
    enabled, so in the general case a username/password is not sufficient.

    On Sat, Aug 31, 2013 at 6:44 AM, Andy W. Song wrote:

    Thanks for pointing it out. Now I see that except the service accounts
    approach there really is no way to get around browser.

    But I really don't see the point. Why is a browser treated more trustable
    than my client app? The end user can use any browser, right? Why can't
    goole let my client app take the end user's credentials and pass it to
    google oauth server to obtain the token?

    On Sat, Aug 31, 2013 at 12:37 PM, Kyle Lemons wrote:

    Actually, there are also service accounts<https://developers.google.com/accounts/docs/OAuth2ServiceAccount>...
    I thought those were just an appengine thing, but the documentation doesn't
    seem to imply that. There is an implementation of jwt<http://godoc.org/code.google.com/p/goauth2/oauth/jwt>in the goauth2 project.

    On Fri, Aug 30, 2013 at 9:26 PM, Kyle Lemons wrote:

    You will have to involve a GUI somehow, regardless of how you do the
    authentication; there is no way (of which I am aware) that lets you use a
    username and password. Even appcfg.py has an --oauth2 flag that uses the
    new oauth method. Perhaps what you're looking for is the device flow<https://developers.google.com/accounts/docs/OAuth2ForDevices>,
    which reverses it a bit: it gives you a URL and a token. The user
    navigates to that URL, logs in, and enters the token. At that point, the
    token you've received from the device flow can be used to authenticate as
    that user (modulo the usual refresh dance when it expires). You should
    only have to do this once every 30 days, if I recall.

    On Fri, Aug 30, 2013 at 8:05 PM, Andy W. Song wrote:

    I understand that I have to get the token somehow.

    But can it be like, say the GAE uploader, you input your credentials
    from command line and get authorized?

    What I don't want is to have to involve GUI in anyway because that
    prevents me from doing it automatically.

    On Sat, Aug 31, 2013 at 8:38 AM, Kyle Lemons wrote:

    You will have to get the token somehow. You can echo the auth URL to
    a console, have someone click it, and set the redirect URL to the NAS for
    instance.

    On Fri, Aug 30, 2013 at 1:11 AM, Andy W. Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to
    Google Drive. When reading the example code I found that in
    function openUrl() it calls up external browser. Is this the only way to do
    the oauth client authorization?

    Usually it's not a problem, but what I'm trying to write is a
    command line tool ideally running on my headless home NAS.

    Thanks
    Andy

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Carlos Castillo at Aug 31, 2013 at 10:50 pm
    Although it's more important when you set up your own web-services, the
    idea is that by using the browser, you are connecting to a google server
    over an SSL connection verified by google's server. You enter the
    authentication information there (not in your app), and so if google
    decides to change/update authentication methods (eg: using the Google
    Authenticator mobile app, or a retinal scan), your app never needs to know
    or change. Also, if the user is already logged into their google account in
    the browser, then they can skip right to the "do you want <<app name>> to
    access <<feature-list>> from your account?" page. It ensures that the
    actual authentication is always done in one place (on google's secure
    servers, that are kept up to date with patches for the latest security
    exploits), and that the app doesn't need or ever see the username/password.
    Users can then be told to: NEVER ENTER YOUR GOOGLE ACCOUNT PASSWORD
    ANYWHERE BUT A GOOGLE SITE.
    On Saturday, August 31, 2013 6:44:34 AM UTC-7, Andy W. Song wrote:

    Thanks for pointing it out. Now I see that except the service accounts
    approach there really is no way to get around browser.

    But I really don't see the point. Why is a browser treated more trustable
    than my client app? The end user can use any browser, right? Why can't
    goole let my client app take the end user's credentials and pass it to
    google oauth server to obtain the token?


    On Sat, Aug 31, 2013 at 12:37 PM, Kyle Lemons <kev...@google.com<javascript:>
    wrote:
    Actually, there are also service accounts<https://developers.google.com/accounts/docs/OAuth2ServiceAccount>...
    I thought those were just an appengine thing, but the documentation doesn't
    seem to imply that. There is an implementation of jwt<http://godoc.org/code.google.com/p/goauth2/oauth/jwt>in the goauth2 project.


    On Fri, Aug 30, 2013 at 9:26 PM, Kyle Lemons <kev...@google.com<javascript:>
    wrote:
    You will have to involve a GUI somehow, regardless of how you do the
    authentication; there is no way (of which I am aware) that lets you use a
    username and password. Even appcfg.py has an --oauth2 flag that uses the
    new oauth method. Perhaps what you're looking for is the device flow<https://developers.google.com/accounts/docs/OAuth2ForDevices>,
    which reverses it a bit: it gives you a URL and a token. The user
    navigates to that URL, logs in, and enters the token. At that point, the
    token you've received from the device flow can be used to authenticate as
    that user (modulo the usual refresh dance when it expires). You should
    only have to do this once every 30 days, if I recall.


    On Fri, Aug 30, 2013 at 8:05 PM, Andy W. Song <wso...@gmail.com<javascript:>
    wrote:
    I understand that I have to get the token somehow.

    But can it be like, say the GAE uploader, you input your credentials
    from command line and get authorized?

    What I don't want is to have to involve GUI in anyway because that
    prevents me from doing it automatically.


    On Sat, Aug 31, 2013 at 8:38 AM, Kyle Lemons <kev...@google.com<javascript:>
    wrote:
    You will have to get the token somehow. You can echo the auth URL to
    a console, have someone click it, and set the redirect URL to the NAS for
    instance.


    On Fri, Aug 30, 2013 at 1:11 AM, Andy W. Song <wso...@gmail.com<javascript:>
    wrote:
    Dear list,

    I'm trying to use google-api-go-client for batch upload files to
    Google Drive. When reading the example code I found that in
    function openUrl() it calls up external browser. Is this the only way to do
    the oauth client authorization?

    Usually it's not a problem, but what I'm trying to write is a
    command line tool ideally running on my headless home NAS.

    Thanks
    Andy

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴

    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rick Tait at Oct 18, 2013 at 12:56 am
    what you need to do is use the certificate that is paired with the
    particular app you have registered in the google cloud console. with that
    key, you craft a json web token. then you get your oauth token from there,
    and that is what you then use to talk "headless" to the actual drive API.

    i'm pulling down analytics data from the core reporting API in exactly this
    manner, with absolutely no "popups" or user intervention required.

    RMT.
    On Friday, August 30, 2013 1:11:59 AM UTC-7, Andy Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to Google
    Drive. When reading the example code I found that in function openUrl() it
    calls up external browser. Is this the only way to do the oauth client
    authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Andy Song at Oct 18, 2013 at 6:16 am
    Wow that's wonderful news. I almost gave up the hope.

    Do you mind sharing your code snippet? Where do I get the certificate that
    you mentioned?

    Thanks
    Andy

    On Fri, Oct 18, 2013 at 8:56 AM, Rick Tait wrote:

    what you need to do is use the certificate that is paired with the
    particular app you have registered in the google cloud console. with that
    key, you craft a json web token. then you get your oauth token from there,
    and that is what you then use to talk "headless" to the actual drive API.

    i'm pulling down analytics data from the core reporting API in exactly
    this manner, with absolutely no "popups" or user intervention required.

    RMT.

    On Friday, August 30, 2013 1:11:59 AM UTC-7, Andy Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to Google
    Drive. When reading the example code I found that in function openUrl() it
    calls up external browser. Is this the only way to do the oauth client
    authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rick Tait at Oct 18, 2013 at 10:13 pm
    FYI full code & docs at https://gist.github.com/rickt/7048919

    RMT.
    On Thursday, October 17, 2013 11:16:13 PM UTC-7, Andy Song wrote:

    Wow that's wonderful news. I almost gave up the hope.

    Do you mind sharing your code snippet? Where do I get the certificate that
    you mentioned?

    Thanks
    Andy


    On Fri, Oct 18, 2013 at 8:56 AM, Rick Tait <ri...@rickt.org <javascript:>>wrote:
    what you need to do is use the certificate that is paired with the
    particular app you have registered in the google cloud console. with that
    key, you craft a json web token. then you get your oauth token from there,
    and that is what you then use to talk "headless" to the actual drive API.

    i'm pulling down analytics data from the core reporting API in exactly
    this manner, with absolutely no "popups" or user intervention required.

    RMT.

    On Friday, August 30, 2013 1:11:59 AM UTC-7, Andy Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to Google
    Drive. When reading the example code I found that in function openUrl() it
    calls up external browser. Is this the only way to do the oauth client
    authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Wenqiang Song at Oct 21, 2013 at 9:03 am
    Hi Rick,

    I read through your code and documentation and found that it might not work
    with Google Drive. The reason is that your solution involves only Google
    who authenticates "you" the Analytics user. But what I would like to do
    with Google Drive involves three parties: Google, me (the app developer
    accessing through API) and the owner of the Drive account so that they can
    use my app to work with data in their accounts.

    Andy

    On Sat, Oct 19, 2013 at 6:13 AM, Rick Tait wrote:

    FYI full code & docs at https://gist.github.com/**rickt/7048919<https://gist.github.com/rickt/7048919>

    RMT.

    On Thursday, October 17, 2013 11:16:13 PM UTC-7, Andy Song wrote:

    Wow that's wonderful news. I almost gave up the hope.

    Do you mind sharing your code snippet? Where do I get the certificate
    that you mentioned?

    Thanks
    Andy

    On Fri, Oct 18, 2013 at 8:56 AM, Rick Tait wrote:

    what you need to do is use the certificate that is paired with the
    particular app you have registered in the google cloud console. with that
    key, you craft a json web token. then you get your oauth token from there,
    and that is what you then use to talk "headless" to the actual drive API.

    i'm pulling down analytics data from the core reporting API in exactly
    this manner, with absolutely no "popups" or user intervention required.

    RMT.

    On Friday, August 30, 2013 1:11:59 AM UTC-7, Andy Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to Google
    Drive. When reading the example code I found that in function openUrl() it
    calls up external browser. Is this the only way to do the oauth client
    authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy
    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@**googlegroups.com.

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rick Tait at Oct 21, 2013 at 1:46 pm
    hey there Andy!

    yeah you're right. that said, i [perhaps mistakenly] assumed that you were
    writing the batch upload tool for your own purposes (running on your home
    NAS, uploading your own files), so you would be "me" and the owner of the
    Drive account. if that is the case, you should be golden.

    if you're looking for a command line tool with no browser interaction for
    use by "other people" with no "user interaction" by those people, well i'm
    not sure that's possible. it used to be that (for example) we could
    authenticate analytics access via username+password, but that is no longer
    possible with the switch over to oauth.

    :-\

    RMT.
    On Monday, October 21, 2013 2:02:40 AM UTC-7, Andy Song wrote:

    Hi Rick,

    I read through your code and documentation and found that it might not
    work with Google Drive. The reason is that your solution involves only
    Google who authenticates "you" the Analytics user. But what I would like to
    do with Google Drive involves three parties: Google, me (the app developer
    accessing through API) and the owner of the Drive account so that they can
    use my app to work with data in their accounts.

    Andy


    On Sat, Oct 19, 2013 at 6:13 AM, Rick Tait <ri...@rickt.org <javascript:>>wrote:
    FYI full code & docs at https://gist.github.com/**rickt/7048919<https://gist.github.com/rickt/7048919>

    RMT.

    On Thursday, October 17, 2013 11:16:13 PM UTC-7, Andy Song wrote:

    Wow that's wonderful news. I almost gave up the hope.

    Do you mind sharing your code snippet? Where do I get the certificate
    that you mentioned?

    Thanks
    Andy

    On Fri, Oct 18, 2013 at 8:56 AM, Rick Tait wrote:

    what you need to do is use the certificate that is paired with the
    particular app you have registered in the google cloud console. with that
    key, you craft a json web token. then you get your oauth token from there,
    and that is what you then use to talk "headless" to the actual drive API.

    i'm pulling down analytics data from the core reporting API in exactly
    this manner, with absolutely no "popups" or user intervention required.

    RMT.

    On Friday, August 30, 2013 1:11:59 AM UTC-7, Andy Song wrote:

    Dear list,

    I'm trying to use google-api-go-client for batch upload files to
    Google Drive. When reading the example code I found that in
    function openUrl() it calls up external browser. Is this the only way to do
    the oauth client authorization?

    Usually it's not a problem, but what I'm trying to write is a command
    line tool ideally running on my headless home NAS.

    Thanks
    Andy
    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@**googlegroups.com.

    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    ---------------------------------------------------------------
    有志者,事竟成,破釜沉舟,百二秦关终属楚
    苦心人,天不负,卧薪尝胆,三千越甲可吞吴
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 30, '13 at 8:12a
activeOct 21, '13 at 1:46p
posts13
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase