This example uses Google Cloud Platform API for reading all users' full profiles.
- The setup of Google Cloud Platform for this module can be found here
- Information about the API can be found at G Suite Admin SDK - Directory API documentation.
-
Read user list from Google Cloud Platform - Standalone Node.js/Javascript Example (under construction)
-
Provide user list from Google Cloud Platform as CAP CDS External Service - Cloud Application Model Example (under construction)
URL : https://www.googleapis.com
Client ID : <OAuth 2.0 Client ID of the Google Service API Credential page>
Client Secret : <content of google service account private key JSON file>
Token Service URL : https://oauth2.googleapis.com/token
jwt.scope : https://www.googleapis.com/auth/admin.directory.user
jwt.sub : <A delegated email address of the Google Suite>
jwts.expiration-time : 3600
jwts.signing-algorithm : RS256
jwts.type : gcp_service_account
Remark:
- jwts are the JSON Web Token Settings for the CDS-SCP-API implementation. At this moment, only jwts.type gcp_service_account is supported.
- jwt are the JSON Web Token Claims, which can be found here and added as SAP Cloud Platform destination additional properties.
- The CDS-SCP-API implementation for jwts.type gcp_service_account will set the JWT claim values for iss and aud from the Client Secret, use the current time for the JWT claim iat, and add the jwts.expiration-time to the current time as value for the JWT claim exp.
const cdsapi = require("@sapmentors/cds-scp-api");
async function InternetAPIGetRequestforGoogleCloudPlatform() {
const domain = '<your-google-cloud-platform-domain>'
const service = await cdsapi.connect.to("GSUITE_JWT")
return await service.run({
url: `/admin/directory/v1/users?domain=${domain}`,
method: `GET`
})
}
InternetAPIGetRequestforGoogleCloudPlatform()
.then((data) => {
console.log(data.users[0].fullName)
})
Robert Eijpe