0

Is it possible to auth to cloud dns api without gcloud or libraries? For example, for api call ManagedZones: list https://cloud.google.com/dns/docs/reference/v1/managedZones/list

I just want to use key from .json file of early created Service account.

What request/url/headers should I use?

Thanks in advance!

Sunny J
  • 453
  • 2
  • 14
  • The question is a bit unclear, hence could you please provide more details. Are you trying to use API key as your method of authentication instead of the Google OAuth 2.0? – Sunny J Jan 04 '19 at 04:29
  • @SunnyJ. thanks for reply. Yes, I'm try API key at first, but getting: "401 unauthorized. Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential." And then I found, that API key don't supported auth method for cloud dns API. So, I'm looking for a simple auth method, using "Service account", but can't figure out, how to use it. – Oleh Isakov Jan 05 '19 at 09:34
  • I have checked this. Currently is not possible to authenticate with a "Service Account". However you may submit this as a feature request using the [issue tracker](https://issuetracker.google.com/issues/new?component=187241&template=1162816). – Sunny J Jan 09 '19 at 03:11

1 Answers1

0

Already found a solution in docs: https://developers.google.com/identity/protocols/OAuth2ServiceAccount

Service account must have a "DNS Administrator" role and associated with project.

The process described in "Preparing to make an authorized API call" on tab "HTTP/REST".

Libraries for generating JWT and debug it can be found at https://jwt.io/

  • This seems like a good workaround, however I would recommend submitting this as a feature request. – Sunny J Jan 16 '19 at 18:59