For other who are here,
All you gotta do is,
go here : https://github.com/DinoChiesa/Apigee-GCS-Get
Download the zip file, extract it, got to - Apigee-GCS-Get-main\Apigee-GCS-Get-main\sharedflows\get-googleapis-token\sharedflowbundle and create a zip file for sharedflowbundle which you can import into your shared flow and deploy.
I too have a usecase where google apigee needs to make an authorized api request to bigquery for fetching a dataset using a service account.
Moving on to the issue i’ve :
once we create a service account with keys, we get a JSON file with client id, keys etc that looks like this :
{
“type”: “service_account”,
“project_id”: “dddd”,
“private_key_id”: “ddddddd”,
“private_key”: “-----BEGIN PRIVATE KEY-----\nddddd\n-----END PRIVATE KEY-----\n”,
“client_email”: “ddd.iam.gserviceaccount.com”,
“client_id”: “122”,
“auth_uri”: “https://accounts.google.com/o/oauth2/auth”,
“token_uri”: “https://oauth2.googleapis.com/token”,
“auth_provider_x509_cert_url”: “https://www.googleapis.com/oauth2/v1/certs”,
“client_x509_cert_url”: “https://www.googleapis.com/robot/v1/metadata/dwwwdwd”
}
What do we do with this file?
i’m a bit confused.
i also have created the shared flow, deployed it and created a flow call out and assign message like you did in the target server side in the proxy meant to reach biq query.
i understood the functionality of most of the policies in the shared flow (AM-Extract-GCP-Token
Cache-Lookup-GCP-Token, Cache-Populate-GCP-Token, Generate-JWT-SelfSigned, JS-ShredCredentialsJson, KVM-Get-ServiceAccountJson, SC-PostToken ) except the JS-ShredCredentialsJson and Generate-JWT-SelfSigned.
What i have done is pasted the JSON file we get after creating a service account with keys onto JS-ShredCredentialsJson like below -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
{
"type": "service_account",
"project_id": "dddd",
"private_key_id": "ddddddd",
"private_key": "-----BEGIN PRIVATE KEY-----\nddddd\n-----END PRIVATE KEY-----\n",
"client_email": "ddd.iam.gserviceaccount.com",
"client_id": "122",
"auth_uri": "[https://accounts.google.com/o/oauth2/auth](https://accounts.google.com/o/oauth2/auth)",
"token_uri": "[https://oauth2.googleapis.com/token](https://oauth2.googleapis.com/token)",
"auth_provider_x509_cert_url": "[https://www.googleapis.com/oauth2/v1/certs](https://www.googleapis.com/oauth2/v1/certs)",
"client_x509_cert_url": "[https://www.googleapis.com/robot/v1/metadata/dwwwdwd](https://www.googleapis.com/robot/v1/metadata/dwwwdwd)"
}
private.
jsc://shredJson.js
And i’m getting the following error :
Please Advice.
@ken-slabs @dchiesa1