The answers in this thread are super helpful.
In my case, I was setting up a 10.7.1 Base Deployment of Esri Enterprise (single machine) on AWS. I installed Server, then configured the web adaptor name as 'server'. Then I intstalled Portal, and a second web adaptor named 'portal'.
When I attempted to log into Portal from outside AWS, it threw me an error (400) of incorrect redirect URI. It appeared to be sending me to /arcgis instead of /portal. I thought that somehow this was misconfigured. So I uninstalled the 'portal' web adaptor and then things got worse. I tried to re-install web adaptors for Portal again, taking great care to name theem appropriately, but kept getting the OP error above and couldn't complete configuration. I checked IIS and there weren't any phantom adaptors. But I was unable to go to the https://aws-machinename/portal/portaladmin page (as noted in this thread above) and check for phantoms because it didn't exist my Portal had no configured web adaptor!
So, I had to uninstall the 'portal' web adaptor, then uninstall Portal application altogether. Restart the machine then reinstall Portal. When I got to installing and configuring a new 'portal' web adaptor, I held my breath but it worked.
However, after configuration, it took me to the Enterprise page and I was able to log in as my portal admin user successfully. The final check was to see if I could access our Portal from an outside location. I could get to the Portal Home page, but when I attempted to log in, it gave me the same 400 redirect URI error!
I found a fix here, and followed scenario 1: Error: 400: Invalid redirect_uri
Sure enough, the web app was configured as my local machine IP instead of the Fully Qualified Domain Name (FQDN) - even though I entered in our domain at configuration(!):
{"appId":"arcgisonline","redirectURIs":["*.arcgis.com","https://my-aws-machine-ip","https://ec2amaz-machinename"]}
so, to fix this, I kept the ec2amaz-machinename but updated the my-aws-machine-ip to our FQDN:
{"appId":"arcgisonline","redirectURIs":["*.arcgis.com","https://subdomain.ourdomain.net","https://ec2amaz-machinename"]}
I hope this helps others, as I lost a solid 4-5 hours in figuring this out. Thankful for these threads as well:
web adaptor not configuring portal
Portal Configuration Error
and also the Error: 400: Invalid redirect_uri technical article.