Subject: Sample code to access cloud.google.com / google compute engine ?
From: "Stephen R. van den Berg" <srb@cuci.nl>
Date: Wed, 15 May 2019 AD 09:30:16 -0400
Does anyone happen to have some boilerplate code which they can share
that uses Pike to get the authorisation tokens required to create
and delete google compute engine instances?
Basically I need to follow this guide:
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
Which means that I have a private service key from google, and need to
use this to create a JWT, which can then be used to request a token.
The token I can then use to call the API.
The question is, how do I use Web.Auth to get my hands on the token?
The example shown in http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Web/Auth.html
appears to be geared towards authorisations that require user approval.
In my case I only need to call some Google API (server to server), no userdata
involved.
--
Stephen.
Return to results