We want to make secure HTTP requests from compute engine to appengine standard, which authenticate using the Appengine Users API
Users API: https://cloud.google.com/appengine/docs/standard/go/users/
GAE standard handler (secured with Users Api - login: required):
handlers:
- url: /securehandler/.*
script: _go_app
login: required
secure: always
We tried using this library to make an authenticated HTTPS request from our compute engine Go application to the above GAE handler:
https://godoc.org/golang.org/x/oauth2/google#ComputeTokenSource
client := &http.Client{
Transport: &oauth2.Transport{
// Fetch from Google Compute Engine's metadata server to retrieve
// an access token for the provided account.
// If no account is specified, "default" is used.
Source: google.ComputeTokenSource(""),
},
}
client.Get("https://myapp.appspot.com/securehandler/search")
We get a 403 Forbidden HTTP error.
Our default compute engine service account has App Engine Admin & Editor permissions in IAM.
Google support told us we should be able to make requests to GAE standard handlers with the default compute engine service account.
Thanks