I get this error if the IDP's token endpoint returns status code other than 200 (for example, 301) with no body: Error: Can't use an undefined value as a HASH reference at /usr/share/perl5/Mojolicious/Plugin/OAuth2.pm line 195. This made us very hard to debug the actual error