Consistently getting http status 500 when trying to perform Oauth2 authentication

I can’t figure what’s wrong. A couple of months ago my iOS app was working fine. Now for some reason, the auth process always terminates with status 500 and following response:
“code”: “internal_service”,
“message”: “An error occurred processing the request”

I also tried performing the process manually issuing the http calls at the command line as suggested in the docs. No luck.

I’ve tried deleting the Oauth client in the admin panel and creating a new one but didn’t help.

Can anyone direct me?