Proper way to set up oauth for a smart proxy?

Problem: A fresh foreman proxy install complains about invalid oauth tokens being passed to the foreman server during registration attempt.

I can make it work by copying the oauth_consumer_key and oauth_consumer_secret values out of /opt/puppetlabs/puppet/cache/foreman_cache_data/ on the foreman server, to the new foreman proxy.

Expected outcome: Not sure if the oauth tokens are expected to have to be copied manually? For automated setup, is there a better way?

Foreman and Proxy versions: 3.7 for foreman; I think it’s the same for proxy.

Foreman and Proxy plugin versions: Not sure how to tell.

Distribution and version: Debian 11

Other relevant data:
This is a follow up to Installing foreman proxy via puppet