-
Improvement
-
Resolution: Fixed
-
Minor
-
3.9.3, 3.10
-
MOODLE_310_STABLE, MOODLE_39_STABLE
-
MOODLE_311_STABLE
-
MDL-70282-oauth2_improve_error -
When OAuth 2 authentication fails due to some failure between Moodle and the issuer you get "error/Could not upgrade oauth token" which provides no information to help troubleshoot the cause. Unless you have access to the OAuth 2 issuer's logs you would have to trace into the Moodle source code to see what's being returned by the issuer – both the HTTP status code and the response body from the HTTP request in which the OAuth 2 issuer may have included helpful information to help resolve the problem. At present this response is ignored by Moodle and thus is unavailable to the admin.
Also: The message "Could not upgrade oauth token" is a hardcoded string, ideally this should be a language string.
Forum posts where people have faced the opaque "Could not upgrade oauth token" error: