Hi Salman,

There are broadly two types of authorization on GCP: user accounts and
service accounts.  User account tokens will act on behalf of a particular
end-user, and service account tokens will act on behalf of that service
account.   I'm not exactly sure which one is right for your application,
based on the information you presented.  User account tokens only need one
user interaction, and then subsequent authorization tokens can be retrieved
using the refresh token produced during 3-legged auth.

If you are looking for a service account
<https://cloud.google.com/iam/docs/service-accounts>, then you can either
pass the service account credentials using the Application Default
Credentials
<https://developers.google.com/identity/protocols/application-default-credentials>
mechanism,
or you can use JWTConfigFromJSON
<https://godoc.org/golang.org/x/oauth2/google#JWTConfigFromJSON> to read
service account JSON in a manner of your choosing.

Hope that helps!
-Ross

On Sat, Nov 18, 2017 at 5:56 AM Sameer Ajmani <sam...@golang.org> wrote:

> +Ross and Jonathan
>
> On Sat, Nov 18, 2017 at 1:26 AM SALMAN AHMED <salmanbukhari...@gmail.com>
> wrote:
>
>> I am trying to automate the VM and Network resource creation using GCD
>> Client API. I do not want to use Google OAuth as the user has to generate
>> token every time. I used AWS SDK and it can be invoked by simply using
>> AccessKey and Secret Key. Is there any authentication method that does
>> not need user's interaction? I saw the Service Account authentication
>> method but could not find any detailed example. Will it work for GCD
>> compute API? and I saw that Service Account is based on environment
>> variable and my app could have multiple users with different accounts.
>>
> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to