OpenID Connect - undefined method error

OpenID Connect - undefined method error

ved Justin McElvaney -
Antal besvarelser: 9

A couple days ago the following error message began presenting anytime a login is attempted via OpenID Connect / AzureAD:

Exception - Call to undefined method auth_oidc\oidcclient::use_chinese_api()

Nothing changed on the Azure side and it doesn't appear anything changed in Moodle. No idea what it is looking for or how to fix but its prevented all logins using the Microsoft credential to login.

Gennemsnitsbedømmelse: -
I svar til Justin McElvaney

Re: OpenID Connect - undefined method error

ved Elín Jóna Traustadóttir -

Hi I also have this problem, anyone got the answer??

I svar til Elín Jóna Traustadóttir

Re: OpenID Connect - undefined method error

ved Leon Stringer -
Billede af Core developers Billede af Particularly helpful Moodlers

What version of the OpenID Connect plugin have you got? It looks like the very latest version, 2020020301 released 15 May 2020, added a call to oidcclient::use_chinese_api() but didn't actually add the corresponding method.

I've added a report (#1267) to the third party's bug tracker.

I svar til Leon Stringer

Re: OpenID Connect - undefined method error

ved Justin McElvaney -

3.8.0.1   2020020301

No luck figuring this one out for me still unfortunately.

I svar til Justin McElvaney

Re: OpenID Connect - undefined method error

ved Leon Stringer -
Billede af Core developers Billede af Particularly helpful Moodlers

Sorry if I wasn't clear: it looks like this is a bug in the third party code in that version.

I svar til Leon Stringer

Re: OpenID Connect - undefined method error

ved Elín Jóna Traustadóttir -
Yes I have this version, so what do we do just wait?

I svar til Elín Jóna Traustadóttir

Re: OpenID Connect - undefined method error

ved Leon Stringer -
Billede af Core developers Billede af Particularly helpful Moodlers

Yes, you can keep an eye on that bug report for any updates from the developers.

If you're not using Office 365 for China you could edit auth/oidc/classes/oidcclient.php changing line 69 from:

            $this->resource = (static::use_chinese_api() === true) ? 'https://microsoftgraph.chinacloudapi.cn' : 'https://graph.microsoft.com';

to:

            $this->resource = 'https://graph.microsoft.com';

Please note that I haven't been able to test this.

Depending on your situation there may be the option of uninstalling the plugin and reverting to the previous version, the bottom of the plugin Versions page allows you to switch to 3.8.0.0. You might need to revert Microsoft Office 365 Integration (local_o365) too. This might be fine for a new site but for an established site with lots of affected users it might be more difficult.

Gennemsnitsbedømmelse:Useful (1)
I svar til Leon Stringer

Re: OpenID Connect - undefined method error

ved Justin McElvaney -

That modification fixes it. I'll keep an eye on the bug tracking but for now it seems that is all it needed. Thanks!

Gennemsnitsbedømmelse:Useful (1)