Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 489
xennygrimmato Avatar asked Sep 02 '25 15:09

xennygrimmato


1 Answers

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.

like image 56
dany L Avatar answered Sep 05 '25 16:09

dany L