Failed to Open Stream Error with OAuth token exchange example

I am following the OAuth token exchange example here running on Magento 2.4.1 on MAMP

I created an integration and copied the 4 PHP files at the root of the server. I create an integration and set it with:

Callback URL : http://magento2:8888/endpoint.php
Identity link URL : http://magento2:8888/login.php

Then upon activation it opens a pop up and I click login then immediately see this error:

Fatal error: Uncaught
OAuthCommonHttpExceptionTokenResponseException:
file_get_contents(http://magento2:8888/oauth/token/request): failed to
open stream: HTTP request failed! HTTP/1.1 400 Bad Request in
/code/MAMP/magento2/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/StreamClient.php:73
Stack trace: #0
/code/MAMP/magento2/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/AbstractService.php(52):
OAuthCommonHttpClientStreamClient->retrieveResponse(Object(OAuthCommonHttpUriUri),
”, Array) #1 /code/MAMP/magento2/checklogin.php(26):
OAuthOAuth1ServiceAbstractService->requestRequestToken() #2 {main}
thrown in
/code/MAMP/magento2/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/StreamClient.php
on line 73

What am I missing??