saylordotorg / moodle-local_discoursesso

A Moodle plugin that enables Moodle to act as a SSO provider for the Discourse discussion platform.
1 stars 1 forks source link

User images not appearing #6

Open theopen-institute opened 5 years ago

theopen-institute commented 5 years ago

Thanks for making this plugin!

For some reason, my avatar images aren't transferring from moodle to discourse. Based on the debug logs, it looks like your discourse sso plugin is doing its job properly, but I don't understand the backend well enough to know how to test that.

I've posted a thread over at meta.discourse.org, but no responses so far. Any ideas? https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878

jazinheira commented 5 years ago

I just upgraded our Discourse to v2.2.0beta9 and I'm seeing the same issue. In your Discourse logs are you seeing this error?

Job exception: undefined method `is_supported_image?' for FileHelper:Class

jazinheira commented 5 years ago

Would you also double check that the profile image is accessible from the internet (or your Discourse server, at least)? The one at https://moodle.***.***/pluginfile.php/42/user/icon/fordson/f1?rev=490

theopen-institute commented 5 years ago

I'm not seeing that error anywhere in the logs, and I can access that link to see an avatar image from any cold browser on any network. It's very strange, as the log seems to indicate that everything should be working. Let me know if there is anything else I can do to help troubleshoot.

(And apologies for the slow response. My github notifications were set improperly.)

theopen-institute commented 5 years ago

On further investigation, it seems pretty clear that this is an authentication problem. I tested from a range of different web browsers and the proper image loaded, but sometimes when I run a curl command from my discourse server itself I get the dummy "no avatar" icon. Strangely, sometimes I get the proper image too. Does the moodle file api require authentication for user icons?

EDIT: Further details: this is also related to the "force login" setting in moodle. My site has force login set to on, but if it's set to off the avatar loads properly.

jazinheira commented 5 years ago

That's interesting, we do NOT have Force login enabled. I'll see if I can find a workaround but in the meantime I'll add that to the docs.

I noticed another "Force users to log in to view user pictures" setting in Moodle. Is that set to on as well on your installation?

theopen-institute commented 5 years ago

The “force login for user pictures” setting is off. If I turn it on, I’m not able to get images again.

Moodle’s “logged in as guest” status is still a bit confusing to me, but I think it’s related to the mechanism here.