Connecting to Twitter with OAuth 2.0

I’m trying to connect to Twitter with the HTTP Oauth 2.0 module, but it’s not working. I have the same issue as this poster, who seemed to resolve the issue, but doesn’t say exactly how the solution works: Connecting to Twitter with OAuth 2.0 and PKCE

@rogerg6722 could you please share how you solved it?