GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Document how to use Service Accounts with dev_appserver · Issue #574 · googleapis/google-cloud-python

Document how to use Service Accounts with dev_appserver #574

New issue
Copy link
New issue
Copy link
Closed
Closed
Document how to use Service Accounts with dev_appserver#574
Copy link
Assignees
lukesneeringer
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.

Description

@dhermes
dhermes
opened on Jan 28, 2015
Issue body actions

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.

Activity

Next
  1. dhermes commented on Jan 28, 2015

    @dhermes
    dhermes
    on Jan 28, 2015
    ContributorAuthor
    More actions

    From dev_appserver.py --help

    Application Identity:
      --appidentity_email_address APPIDENTITY_EMAIL_ADDRESS
                            email address associated with a service account that
                            has a downloadable key. May be None for no local
                            application identity. (default: None)
      --appidentity_private_key_path APPIDENTITY_PRIVATE_KEY_PATH
                            path to private key file associated with service
                            account (.pem format). Must be set if
                            appidentity_email_address is set. (default: None)
    

    ISTM that .pem is not necessary, but if it is, that is quite alright

  2. jgeewax
    added
    documentation
    on Jan 30, 2015
  3. jgeewax
    modified the milestone: This milestone has been deleted on Jan 30, 2015
  4. dhermes
    modified the milestones: This milestone has been deleted, This milestone has been deleted on Feb 9, 2015
  5. dhermes commented on Feb 21, 2016

    @dhermes
    dhermes
    on Feb 21, 2016
    ContributorAuthor
    More actions

    Played around a bit with this and the dev_appserver support is pretty bad. It doesn't support JSON keyfiles or P12 keyfiles, so a user has manually take one of them and extract the PEM contents of the key. Even still, after doing that, it only supports PEM PKCS#1 keys (BEGIN RSA PRIVATE KEY) while the keys in JSON keyfiles are PKCS#8 (BEGIN PRIVATE KEY).

  6. dhermes commented on Feb 21, 2016

    @dhermes
    dhermes
    on Feb 21, 2016
    ContributorAuthor
    More actions

    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']
    '[email protected]'
    >>> 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 \
    > [email protected] \
    > --appidentity_private_key_path=/path/to/keyfile-PKCS1.pem \
    > ${APPLICATION_DIR}
    
    Reacted by Surya Kasturi, Emmanuel Olowosulu, Mehmet Bora Ezer, Sam Brotherton, Kenji Imamula and Nicholas Austrom
    Reacted by Sam Brotherton
  7. dhermes commented on Feb 21, 2016

    @dhermes
    dhermes
    on Feb 21, 2016
    ContributorAuthor
    More actions

    @jgeewax Do you think this is worth adding to our auth doc or should I just give up on it and close out this issue?

  8. voscausa commented on Feb 22, 2016

    @voscausa
    voscausa
    on Feb 22, 2016
    More actions

    Yes, because you do not have to store the key in your project. You can also use this setup to create signed urls to access Google Cloud storage in the development server using app_identity.sign blob() and the app default service account, without modifying your application. This default service account cannot be used as an ouath2client service account, because it does not have a client_id.

  9. dhermes commented on Feb 29, 2016

    @dhermes
    dhermes
    on Feb 29, 2016
    ContributorAuthor
    More actions

    @jgeewax Can you weigh in here?

  10. dhermes commented on Mar 3, 2016

    @dhermes
    dhermes
    on Mar 3, 2016
    ContributorAuthor
    More actions

    @jgeewax Bump

  11. dhermes commented on Mar 17, 2016

    @dhermes
    dhermes
    on Mar 17, 2016
    ContributorAuthor
    More actions

    @jgeewax Bump

  12. 4 remaining items

  13. lukesneeringer commented on Aug 11, 2017

    @lukesneeringer
    lukesneeringer
    on Aug 11, 2017
    Contributor
    More actions

    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!

  14. lukesneeringer
    closed this as completedon Aug 11, 2017
  15. dhermes
    added a commit that references this issue on Oct 11, 2017

    Adding beginnings of a system tests URL.

    37d3201
  16. JustinBeckwith
    assigned
    lukesneeringer
    on Feb 1, 2021
  17. parthea
    added 3 commits that reference this issue on Oct 21, 2023

    chore: Update gapic-generator-python to v1.11.4 (#574)

    b5e3e24

    Add translate samples [(#574)](GoogleCloudPlatform/python-docs-sample…

    ec0d88f

    feat!: migrate API to microgenerator (#31)

    00a2690
  18. parthea
    added a commit that references this issue on Aug 21, 2025

    chore(deps): bump ipython from 7.31.1 to 8.10.0 in /samples/to_datafr…

    253608b
  19. parthea
    added a commit that references this issue on Sep 16, 2025

    chore(deps): bump ipython from 7.31.1 to 8.10.0 in /samples/to_datafr…

    1fc992f
  20. parthea
    added 2 commits that reference this issue on Nov 24, 2025

    chore: release 0.32.0 (#574)

    50689a5

    chore(python): update dependencies in .kokoro/docker/docs (#574)

    07a3f50
  21. parthea
    added 4 commits that reference this issue on Mar 2, 2026

    chore: use gapic-generator-python 0.62.1 (#574)

    6b3a5c2

    chore(deps): update precommit hook pycqa/flake8 to v3.9.0 (#574)

    1eab861

    fix: fix healthchecks app tutorial (#574)

    541789c

    chore(deps): update dependency deprecated to v1.2.18 (#574)

    4bf93c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lukesneeringer
    lukesneeringer

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.