From there on, I recommend PHP developers to first verify the up-to-date API URL with Google OAuth 2.0 Playground and follow the 3 steps there.
First select the same scopes
as defined in the Google Oauth consent screen page:
Click Authorize APIs.
Simply follow step 2.
In step 3, click the List possible operations
button and select Get Userinfo
.
This selection will generate the right Request URI to use in the API Action
of the Workflow, to which you add a question mark: ? (since the url will expect further parameters)
https://www.googleapis.com/oauth2/v2/userinfo?
Then follow this instruction for finalizing the API Action:
Back to OAuth playground, hit the Send the request
button to generate the JSON response. This is instead of opening the server action in you browser to get the JSON response. Copy the part highlighted below, including the curly brackets:
And copy it where you define the API schema of your API action:
This will generate the right schema. Then you can follow all the steps from this part:
Check if the user exists in the database
Note that the Google profile sub ID
may appear as id
in the dynamic data picker.
Google page with all the OAuth 2.0 instructions for your reference: