OpenID Connect - undefined method error

OpenID Connect - undefined method error

Justin McElvaney -
Atsakymų skaičius: 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.

Įvertinimų vidurkis: -
Atsakymas į Justin McElvaney

Re: OpenID Connect - undefined method error

Elín Jóna Traustadóttir -

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

Atsakymas į Elín Jóna Traustadóttir

Re: OpenID Connect - undefined method error

Leon Stringer -
Core developers paveikslėlis Particularly helpful Moodlers paveikslėlis

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.

Atsakymas į Leon Stringer

Re: OpenID Connect - undefined method error

Justin McElvaney -

3.8.0.1   2020020301

No luck figuring this one out for me still unfortunately.

Atsakymas į Leon Stringer

Re: OpenID Connect - undefined method error

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

Atsakymas į Elín Jóna Traustadóttir

Re: OpenID Connect - undefined method error

Leon Stringer -
Core developers paveikslėlis Particularly helpful Moodlers paveikslėlis

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.

Atsakymas į Leon Stringer

Re: OpenID Connect - undefined method error

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!