# gce.py issues authenticating to GCE

**URL:** <https://forum.ansible.com/t/gce-py-issues-authenticating-to-gce/20164>\
**Category:** Ansible Project\
**Created:** [January 9, 2016, 4:07pm UTC](https://forum.ansible.com/t/gce-py-issues-authenticating-to-gce/20164 "2016-01-09T16:07:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Leonhardt](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Alex\_Leonhardt](https://forum.ansible.com/u/Alex_Leonhardt)\
**Post date:** [January 9, 2016, 4:07pm UTC](https://forum.ansible.com/t/gce-py-issues-authenticating-to-gce/20164/1 "2016-01-09T16:07:18Z")

</div>

Hi,

So I’ve been trying to get gce to work, but no luck - it used to work, something changed, and now it isn’t - not sure what happened, but I tried to setup everything from scratch again …

On GCE, I’ve created a service account, when creating the account, I ticked the box to allow domain-wide delegation (DwD), the p12 got downloaded automatically and the pem extracted with the command from the ansible site ([https://docs.ansible.com/ansible/guide\_gce.html#credentials](https://docs.ansible.com/ansible/guide_gce.html#credentials)) and stored as ansible.pem, I then clicked on “View client ID”, edited the name (ansible) and saved it.

I’ve attached some screenshots that should help (I hope) …

[https://console.developers.google.com/apis/credentials?project=projectname](https://console.developers.google.com/apis/credentials?project=projectname)

[![](https://lh3.googleusercontent.com/-N1XQgAEgtEI/VpEt2cE5AsI/AAAAAAAAFk4/-NJDzr1EmSY/s320/oauth2clientids.png)](https://lh3.googleusercontent.com/-N1XQgAEgtEI/VpEt2cE5AsI/AAAAAAAAFk4/-NJDzr1EmSY/s1600/oauth2clientids.png)

[![](https://lh3.googleusercontent.com/-pz3l-MR84II/VpEt6YDeIkI/AAAAAAAAFlA/D_gKcfebC5Y/s320/serviceaccounts.png)](https://lh3.googleusercontent.com/-pz3l-MR84II/VpEt6YDeIkI/AAAAAAAAFlA/D_gKcfebC5Y/s1600/serviceaccounts.png)

Service account details / list :

[![](https://lh3.googleusercontent.com/-zEB2BcizsUc/VpEuDOyTzPI/AAAAAAAAFlI/cBGSfKcvIsQ/s320/serviceaccountsdetail.png)](https://lh3.googleusercontent.com/-zEB2BcizsUc/VpEuDOyTzPI/AAAAAAAAFlI/cBGSfKcvIsQ/s1600/serviceaccountsdetail.png)

View client detail :

[![](https://lh3.googleusercontent.com/-XO0P411aA-Q/VpEuLctkSmI/AAAAAAAAFlQ/NYdhUM59KX4/s320/serviceaccountsdetail-ansible-viewclientid.png)](https://lh3.googleusercontent.com/-XO0P411aA-Q/VpEuLctkSmI/AAAAAAAAFlQ/NYdhUM59KX4/s1600/serviceaccountsdetail-ansible-viewclientid.png)

The secrets.py has the following :

```auto
GCE_PARAMS = ('ansible@ ********.iam.gserviceaccount.com', '/full/path/to/ansible.pem')
GCE_KEYWORD_PARAMS = {'project': ' ********'}

```

The gce.ini has the following :

```auto
[gce]
libcloud_secrets = /full/path/to/secrets.py

```

But now I get this output :

> Please Go to the following URL and sign in:  
> [https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full\_control+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fndev.clouddns.readwrite&state=Libcloud+Request&redirect\_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response\_type=code&client\_id=ansible%40\*\*\*\*\*\*\*\*.iam.gserviceaccount.com](https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fndev.clouddns.readwrite&state=Libcloud+Request&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=ansible%40 ********.iam.gserviceaccount.com)  
> Enter Code:

Anyone got any ideas ? Any way to debug this ?

Thanks!  
Alex

---

<div class="post-metadata">

**Author:** ![Eric\_Johnson](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Eric\_Johnson](https://forum.ansible.com/u/Eric_Johnson)\
**Post date:** [January 11, 2016, 7:03pm UTC](https://forum.ansible.com/t/gce-py-issues-authenticating-to-gce/20164/2 "2016-01-11T19:03:49Z")

</div>

I haven’t done any testing to confirm, but it could be related to this: [https://github.com/apache/libcloud/commit/88170f6582dd6cc3bce87c0ab3a89118551fe508](https://github.com/apache/libcloud/commit/88170f6582dd6cc3bce87c0ab3a89118551fe508) and ansible not yet supporting the new email address format for client\_id. You could try running libcloud from trunk (or making that one-line hack to your local install) to see if that fixes the issue.
