Override profile background via SSO

pr-welcome

(Emma Lejeck) #1

Profile “backgrounds” or “cover images” are becoming extremely common. Facebook has 'em, Twitter has 'em, MySpace had 'em all the way back in 1997 or whenever it was.

SSO is for integrating with a site. Some of those sites will have profile backgrounds or cover images. Ergo, SSO should provide the ability to override this alongside the ability to override avatars. I assume much of the implementation would be similar.


Discourse in Outreachy Summer 2018
(Jeff Atwood) #2

Before we do this, we’d need to start pulling avatars via SSO first!


(Sam Saffron) #3

We do already :slight_smile: I don’t mind this being added as well


(Mike Sider) #4

Hello @sam, Do you know if there has been any development with pulling the profile backgrounds with SSO?
Photography based sites like ours could benefit from this feature. Thanks.


(Yihan "Misaka 0x4e21" X.) #5

Hello there, I’m seeking the opportunity to apply for Outreachy internship with Discourse.

I currently maintains a Discourse forum for transgenders with a customized theme and thus have got some UI experience from it. I’m not much familiar with Rails, though.

For my first contribution, I tried adding this feature into the core. However, I stuck in debugging that the job to download profile background can be executed successfully from rails c, but not from the app/models/discourse_single_sign_on.rb.
Here is my code.

I also wondered if this could be used as a contribution for application or I must choose the two plugins listed on the description page.

Sincerely thanks for your help.


(Sam Saffron) #6

I think it is fine to use it as a contribution for the application.


(Arpit Jalan) #8

This is … unexpected. Few pointers to debug:

  • Is your Discourse dev environment set up properly? (for reference: macOS dev guide, Ubuntu dev guide.)

  • Is the Sidekiq and Rails application running in different Rails environments?

  • Are you seeing any relevant errors in /logs?

  • Can you verify that other jobs are getting enqueued and executed successfully?


(Yihan "Misaka 0x4e21" X.) #9

Thank you for the tips.

I found that the url argument I used in rails console enqueueing was on a remote site while the sso_url set in SiteSetting was one a local one. The function FileHelper.download refused to download an image from a site with IP address in private ranges.

I sent a Pull Request just now.


(Jeff Atwood) #10

For security reasons, we almost never want to grab anything from a private IP range.


(Karl Romanowski) #11

This pr looks like it stalled. Is there another way of doing this via custom fields? Would be a great feature.