Link to canonical user profile from Discourse profile in SSO setup


(Stuart Campbell) #1

Hello,

I apologise if this has been asked elsewhere already — I couldn’t find exactly what I was looking for.

In an SSO setup, is there a way to show, on a user’s Discourse profile, a link to their canonical user profile?

For example, given the Discourse URL Log In | 99designs, can I somehow include a link back to the canonical profile on 99designs.com? (In this case it’s stuart99 | 99designs, but the usernames won’t necessarily match.)


(Robin Ward) #2

Hi Stuart,

We’d need an (admittedly simple) plugin for that. The main problem is that the usernames wouldn’t always match like you say. Maybe we could add a custom field where people add their 99designs username, and use that for the link?


(Stuart Campbell) #3

Actually, in addition to https://99designs.com/profiles/[username], we also have https://99designs.com/profiles/[external-id]. Not sure if that simplifies things at all.


(Robin Ward) #4

I wonder if it would be possible to get the 99 designs username via SSO. If we could do that I could easily set this up for you. I will look into it!


(Stuart Campbell) #5

Now that I think about it some more, the link would have to be e.g. https://99designs.com/profiles/[external-id], since the 99designs username is again different from the user’s customisable URL.

So, Log In | 99designs would need to link to https://99designs.com/profiles/886179, etc.

Anyway — let me know what you come up with. Thanks for investigating!


(Robin Ward) #6

I looked into it, and we had the external user id so it was easy to add!

I’ve just deployed a plugin that links a discourse plugin on 99designs to their user profile on 99designs. Check it out.


(Stuart Campbell) #7

Fantastic! Thanks very much! :smile:


(Florian Bender) #8

May you please point me to where I can find that plugin? I have a similar issue with an existing Contao installation that acts as SSO provider for Discourse.


(Rysher) #10

Were you able to find that plugin or solve this issue somehow different?
I also need to link to Discourse profile by external user id.
Thanks.


(Florian Bender) #11

No, sorry. And it appears there’s no way to provide an external profile link via SSO, unfortunately [1], where it would be easiest to add, IMHO.

@eviltrout Do you think this could be a worthwhile addition to the SSO API, i.e. providing a field with a URL to a user’s (external) profile view? Discourse could then link to that external profile view throughout the system instead of the Discourse-internal one.

[1] discourse/single_sign_on.rb at 6ff7bf7505fcba84a0072649a99b67b91c6a10a6 · discourse/discourse · GitHub


(Robin Ward) #12

In the past we’ve created a custom plugin to do this. I think it probably does not need to be part of Discourse core, but I think a generic plugin that offers this functionality would be appreciated.