I moved my app to a different server as part of a rewrite, and forgot to update the URL of the app on Stack Apps. When I tried to send a query to https://stackexchange.com/oauth and pass my (old, incorrect) callback URL to the
redirect_uri parameter, this is the error I got:
Application Login Failure
An error occurred while login into an application.
error description: Cannot return to provided redirect_uri
I’m still debugging, so I don’t know for sure that that was the issue, but either way, this error message could be a lot more helpful. I don’t know if this is the right place to file a bug/question like this, so I’m happy to post this elsewhere.
Update: I pointed the app at my new domain, and it’s working now, so it was a domain mismatch. I’m leaving this open in case it counts as a support request, because this took several hours to debug. Even after I had fixed the domain, I had a typo that meant I was getting the same error message. Just printing out the received and expected URLs would have made the problem instantly clear.