question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document how to use Service Accounts with dev_appserver

See original GitHub issue

It can be done via

$ dev_appserver.py \
> --appidentity_email_address ${EMAIL_ADDRESS} \
> --appidentity_private_key_path ${PATH_TO_KEY} \
> ${APPLICATION_DIR}

This will make implicit credentials “just work” on the dev appserver for GAE.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

7reactions
dhermescommented, Feb 21, 2016

OK I was able to get it working with a JSON keyfile (H/T S/O), but I don’t know if it’s worth documenting since it is so broken difficult to use:

$ python
>>> import os
>>> JSON_CREDS = os.getenv('GOOGLE_APPLICATION_CREDENTIALS')
>>> JSON_CREDS
'/path/to/keyfile.json'
>>> import json
>>> with open(JSON_CREDS, 'rb') as fh:
...     key_json = json.load(fh)
...
>>> pkcs8_pem = key_json['private_key']
>>> key_json['client_email']
'foo@proj.gserviceaccount.com'
>>> name, ext = os.path.splitext(JSON_CREDS)
>>> PEM_FILE = name + '-PKCS8.pem'
>>> with open(PEM_FILE, 'wb') as fh:
...     fh.write(pkcs8_pem)
...
>>>
$ # Then convert to PKCS1
$ openssl rsa -in /path/to/keyfile-PKCS8.pem -out /path/to/keyfile-PKCS1.pem

and after doing this, the PKCS#1 PEM-file can be used:

$ dev_appserver.py \
> --appidentity_email_address=foo@proj.gserviceaccount.com \
> --appidentity_private_key_path=/path/to/keyfile-PKCS1.pem \
> ${APPLICATION_DIR}
0reactions
lukesneeringercommented, Aug 11, 2017

Hello, One of the challenges of maintaining a large open source project is that sometimes, you can bite off more than you can chew. As the lead maintainer of google-cloud-python, I can definitely say that I have let the issues here pile up.

As part of trying to get things under control (as well as to empower us to provide better customer service in the future), I am declaring a “bankruptcy” of sorts on many of the old issues, especially those likely to have been addressed or made obsolete by more recent updates.

My goal is to close stale issues whose relevance or solution is no longer immediately evident, and which appear to be of lower importance. I believe in good faith that this is one of those issues, but I am scanning quickly and may occasionally be wrong. If this is an issue of high importance, please comment here and we will reconsider. If this is an issue whose solution is trivial, please consider providing a pull request.

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service accounts | IAM Documentation | Google Cloud
Applications use service accounts to make authorized API calls by authenticating as either the service account itself, or as Google Workspace or Cloud...
Read more >
Google Cloud Service Account VS. End User Account
1 Answer 1 · Step 1: Create a service account and download · Step 2: Configure gcloud and the SDKs to use the...
Read more >
Set up a Google Cloud service account for Looker Studio
Instructions on creating a service account can be found in the Google Cloud IAM documentation. You can use either the Cloud console or...
Read more >
an existing connection was forcibly closed by the remote host ...
And it also works in Dev App Server via SqlPlus. There will be a list of options on the left side. AOS will...
Read more >
Service Accounts - Box Developer Documentation
Explore the Box APIs and SDKs to use for app development, API documentation, developer support resources, and access the Box Developer Console.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found