Sso overrides avatar doesn't work in 1.3.0.beta5 nor 1.3.0.beta4

wordpress
sso

(Rodrigo) #1

Hi,

I’m using SSO with wordpress and using the GitHub - discourse/wp-discourse: WordPress plugin that lets you use Discourse as the community engine for a WordPress blog plugin in wordpress. I’ve enabled in discourse:

  • enable sso
  • enable sso provider
  • sso url
  • sso secret
  • sso overrides email

And SSO works just fine. But I’d like the avatar to by in sync too. In the users that have used SSO, in the admin panel, it shows under the Single Sign On title (besides more info):

  Profile Picture URL
  http://<site>/wp-content/uploads/avatars/3/517c3131f47cf76d62429e2196a6ff56-bpfull.jpg

And that URL works just fine.

But if I enable the “sso overrides avatar” SSO stops working. When someone tries to login, it gives the following error: “Error updating information, contact site admin”

I think this is a bug in discourse, because when not using the “sso overrides avatar” option everything works fine and the information on that user to the profile picture under the Single Sign On info, it’s totally fine.

If I can help in any way, test or something, please let me know

Thanks a lot,
Rodrigo


(Logan Mathews) #2

On my installation (using a Drupal Module and the same Discourse settings as you) the avatar override settings work correctly.

Looking over the GitHub repository that you linked, while it does support using Discourse’s avatars for comments within WP, it does not support overriding the user’s avatar from WP to Discourse.


(Rodrigo) #3

Sorry, I don’t follow. Why you say that reading the repo i linked (GitHub - discourse/wp-discourse: WordPress plugin that lets you use Discourse as the community engine for a WordPress blog) it does not support overriding the user’s avatar from WP to Discourse ?

The option “sso overrides avatar” isn’t expected to do exactly that ? What am I missing ?


(Logan Mathews) #4

The option “sso overrides avatar” does indeed do that. I assume you’re seeing that option on the Discourse site and not the wordpress site, correct? If so, you’re enabling an SSO provider to provide the avatars but it can’t do that unless the SSO provider (in this case WP) provides the information.

I came to the conclusion that the WP plugin doesn’t provide its avatars to Discourse (but does allow discourse’s avatars to be used in the comments of a WP page by looking over a few key files.

In particular though, wp-discourse/lib/sso.php has no mention of the user_avatar but does include all of the other common sso payload elements (nonce, email, external_id). As such, it would seem to be a pretty safe assumption that it doesn’t support providing avatars ‘to’ discourse.


(Steven Greco) #5

Sounds like a permission issue on the discourse side. Is there anything in the discourse logs when you have the option on?

I am running beta5 with WordPress plugin and sso is working with avatar sso override turned on.


(Rodrigo) #6

But as admin, seeing the details of the user, it shows a profile picture link, that works. So the info is received by discourse. So, maybe the code is tricky, but it’s sending it… Just that discourse fails to override it IMHO


(Rodrigo) #7

Ohhh, it was permissions! As soon as you said that, didn’t check the logs but removed the auth basic from WP and it works now! Thanks!!