To make a long story short, my OAuth app started failing today when run from my laptop with the error:
403 Client Error: Forbidden for url: https://meta.wikimedia.org/w/index.php?title=Special%3AOAuth%2Finitiate
I assume this is related to T400119. I don't yet fully understand everything that is going on, but it was working yesterday and works now when run inside toolforge. I get the "it works inside toolforge" part, based on what T400119 says, but I don't understand why it worked yesterday on my laptop.
I am aware of the user-agent policy and was setting an appropriate user-agent string in my app. But apparently there's a different code path through the python-social-core library that didn't pick that up, so it was sending the default "User-Agent: python-requests/2.32.4" in the OAuth flow.
Anyway, what should happen is the 403 error should be more explicit. It's good that it tells you what URL it failed on, but it should also tell you that the failure was due to a user-agent policy violation, and include a link to T400119 or some other place which describes this policy. It should also include the user-agent string that was received. Just saying "Forbidden" doesn't give the user any idea what actually went wrong. I spent most of this afternoon trying to figure out what I had done wrong with my consumer credentials, which was totally unrelated to the real problem.