"The system account was not connected for offline access" Facebook

Re: "The system account was not connected for offline access" Facebook

by Andrew Fruin -
Number of replies: 3

I have not found an answer to this but upon investigation of the source code I did discover that in the file issuers.php this is the line which fails and results in the error we are all experiencing.

So what is failing is the function that is connecting the "system_account" to the $issuer (Facebook).
if (core\oauth2\api::connect_system_account($issuer, new moodle_url('/admin/tool/oauth2/issuers.php', $params)))

So what is failing is the function that is connecting the "system_account" to the $issuer (Facebook).

Not much help but I'm not giving up...

In reply to Andrew Fruin

Re: "The system account was not connected for offline access" Facebook

by Robert Schrenk -
Picture of Core developers Picture of Plugin developers
After several MONTHS (Since early 2021) the problem did not occur again, but today suddenly it did. Did anybody gain more insight, what causes this misbehavior?
In reply to Robert Schrenk

Re: "The system account was not connected for offline access" Facebook

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

The scheduled task Refresh OAuth tokens for service accounts (\core\oauth2\refresh_system_tokens_task) refreshes the OAuth 2 token for system accounts.

So you could check that the Moodle cron is being run and whether there are any errors in the logs for this specific task (enabling debugging may show more details).

In reply to Leon Stringer

Re: "The system account was not connected for offline access" Facebook

by Robert Schrenk -
Picture of Core developers Picture of Plugin developers

Thank you - after a few attempts it worked. As it occurs very seldom, I have not further investigated the cause.