How can I use Service Callout to get Google Cloud Token?

Hitting error when trying to get the Google Token in postman:

{

    "fault": {

        "faultstring": "Execution of ServiceCallout SC-TEST-AccessToken failed. Reason: ResponseCode 404 is treated as error",

        "detail": {

            "errorcode": "steps.servicecallout.ExecutionFailed"

        }

    }

}

I also have the Service Account Token role and my service callout is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ServiceCallout async="false" continueOnError="false" enabled="true" name="SC-TEST-AccessToken">

  <Request clearPayload="true">

    <Set>

      <Verb>GET</Verb>

    </Set>

  </Request>

  <Response>testTokenResponse</Response>

  <HTTPTargetConnection>

    <URL>https://apigee.googleapis.com/target/token?project_id=(PII Removed by Staff);scopes=https://www.googleapis.com/auth/cloud-platform</URL>

    <Properties>

      <Property name="success.codes">200</Property>

    </Properties>

  </HTTPTargetConnection>

</ServiceCallout>

Hello @Wai_Hoong99 ,

What are you explicitly trying to generate an access token for, and have you reviewed the following to help assist:
Google Auth Element in a Service Callout Policy to streamline token generation: ServiceCallout policy  |  Apigee  |  Google Cloud
Best practices for deploying proxies with Google Auth: Using Google authentication  |  Apigee  |  Google Cloud

A 404 exception is indicative of a route not being found, and if you put the URL being consumed into your browser you will see the same exception.

If you are able to provide more details we should be able to assist accordingly, thanks!

That’s not a path that will resolve to anything.

There’s nothing listening at that URL. What do you REALLY want to do?
??

This example shows 4 ways to get a token (in this case, an ID token) that will allow an Apigee proxy to connect to a Cloud Run service.

If you need an access token, the idea is the same, you’d just need to make slight adjustments.