xennygrimmato
xennygrimmato

Reputation: 2796

Stackdriver Logging API authentication issue via API Key mechanism

I am trying to fetch stackdriver log entries using this REST API: https://logging.googleapis.com/v2/entries:list?key={MY_API_KEY}

I have created an API Key as per the steps mentioned here and set API restrictions to Stackdriver API, Stackdriver Logging API and Stackdriver Monitoring API.

Request Body

"resourceNames": [
    "projects/{MY_PROJECT}"
  ]
}

Response

{
    "error": {
        "code": 403,
        "message": "The caller does not have permission",
        "status": "PERMISSION_DENIED"
    }
}

What am I missing here? What do I need to modify to make this work? The same API call works via the OAuth2.0 authentication mechanism, but not with the API Key mechanism.

Note: My use-case requires me to use the REST APIs, and I cannot use the Service Account + SDK flow.

Upvotes: 4

Views: 1077

Answers (1)

dany L
dany L

Reputation: 2654

This method of authentication is not currently possible as per this documentation. Logging and Monitoring API do not support API key authentication at this point.

This feature request is currently being worked on. You can use this link to directly communicate with the team that is handling the request.

Upvotes: 4

Related Questions