Using Console
Using CLI
Using Python
google.auth.default()
function. Next, we get the API key metadata and create the API key restriction using the iam_credentials_client.generate_access_token()
method. Finally, we print the new access token.Note that you need to replace the allowed_hosts
and allowed_apps
lists with your own values. Also, make sure to replace my-api-key
with the name of your API key.