Skip to content

Commit

Permalink
fix(functions): clarify auth comments (#1427)
Browse files Browse the repository at this point in the history
* fix: clarify auth comments

* Fix lint

Co-authored-by: Benjamin E. Coe <bencoe@google.com>
Co-authored-by: Daniel Bankhead <danielbankhead@google.com>
  • Loading branch information
3 people committed Aug 19, 2022
1 parent 415108b commit 7e06732
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions samples/idtokens-serverless.js
Expand Up @@ -33,16 +33,30 @@ function main(
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// [END functions_bearer_token]
// [END cloudrun_service_to_service_auth]

// [START cloudrun_service_to_service_auth]
// Example: https://my-cloud-run-service.run.app/books/delete/12345
// const url = 'https://TARGET_HOSTNAME/TARGET_URL';

// [END functions_bearer_token]
// Example (Cloud Run): https://my-cloud-run-service.run.app/
// [START functions_bearer_token]
// const targetAudience = 'https://TARGET_AUDIENCE/';
// [END cloudrun_service_to_service_auth]

// [START functions_bearer_token]
// For Cloud Functions, `endpoint` and `audience` should be equal.

// Example: https://project-region-projectid.cloudfunctions.net/myFunction
// const url = 'https://TARGET_HOSTNAME/TARGET_URL';

// Example (Cloud Functions): https://project-region-projectid.cloudfunctions.net/myFunction
// [START cloudrun_service_to_service_auth]
// const targetAudience = 'https://TARGET_AUDIENCE/';
// [END functions_bearer_token]

// [START functions_bearer_token]
// [START cloudrun_service_to_service_auth]

const {GoogleAuth} = require('google-auth-library');
const auth = new GoogleAuth();

Expand Down

0 comments on commit 7e06732

Please sign in to comment.