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
file_get_contents(http://magento2:8888/oauth/token/request): failed to
open stream: HTTP request failed! HTTP/1.1 400 Bad Request in
Stack trace: #0
”, Array) #1 /code/MAMP/magento2/checklogin.php(26):
OAuthOAuth1ServiceAbstractService->requestRequestToken() #2 {main}
thrown in
on line 73

What am I missing??