Add link to external SSO profile to profile page


(Jay Pfaffman) #1

If you use SSO and profile settings are controlled by another site, it’s confusing that you cannot change them on your profile page.

Can someone show me how to add something like a “Edit Profile on SITE” button to the nav menu on the user preferences page?

Or, is there some better idea?


(Jeff Atwood) #2

Being a parent (authentication site) entails so many responsibilities, Jay!


Can't make user admin, reverts when logging in
(Jay Pfaffman) #3

That’s so true. It would be nice, though, if the child had a way to tell people just where its parent was.


(Rafael dos Santos Silva) #4

I had a site like that, and the only thing that users had to change on parent was the avatar. I went with a site customization of the preferences template that changed the avatar button (the little pencil) to a link to the outsite avatar service.

You need to check for changes on the original template on every update tough.


(Jeff Atwood) #5

Perhaps we should have an easier way to make that happen? Some kind of button that says

Hey if you want to change any of this click here on this GIANT BUTTON to go to your profile page on the parent site


(cpradio) #6

At SP we customized a template to tell our users that too when we switched to SSO. I’ll see if I can find it here in a moment.

Here it is


(Jay Pfaffman) #7

Yeah. That seems good. So then I’d somehow customize the template like this?

Or submit a PR with something like @cpradio’s changes merged into discourse/preferences.hbs at master · discourse/discourse · GitHub?


(cpradio) #8

Yeah, I was about to say that myself. It seems we customized that in our fork. Oops.
I’ll bet a PR to add that will be received well. I’ll see what I can do here in a bit.


(cpradio) #9

PR Submitted (ping @nec286)

@pfaffman, you would use this #howto to implement it via a site customization (also see example below)

<script type='text/x-handlebars' data-template-name='/connectors/above-user-preferences/sso_notice'>
{{#if siteSettings.enable_sso}}
  modified contents of connectors/above-user-preferences/sso_notice.hbs file goes here
{{/if}}
</script>  

(Jay Pfaffman) #10

Thanks, @cpradio. That seems like what I want.

Oh, and now I think that I understand that this won’t work until your PR has been accepted?

Otherwise, I thought that if I paste this into /admin/customize/css_html/ in the </head> tag.

<script type='text/x-handlebars' data-template-name='/connectors/above-user-preferences/sso_notice'>
{{#if siteSettings.enable_sso}}
  <div class="alert alert-info">
      <p>MY FANTASTIC TEXT.</p>
    </div> 
{{/if}}
</script> 

But that isn’t showing up on /users/pfaffman/preferences.

And then I tried

<script type='text/x-handlebars' data-template-name='/connectors/above-user-preferences/sso_notice'>
  <div class="alert alert-info">
      <p>MY FANTASTIC TEXT.</p>
  </div> 
</script> 

And still no joy.


(cpradio) #11

Correct. My PR is necessary for it to work. I didn’t realize that outlet was in our fork :frowning:


(Jay Pfaffman) #12

Aha! I finally (kinda sorta thought that maybe I had) figured that out.

Thanks again.


(cpradio) #13

@pfaffman, this is now merged, so let me know if it still doesn’t work after you update to latest. :slight_smile:


(Jay Pfaffman) #14

It works! It works! Thanks @cpradio. Discourse 1.8.0.beta7.


(Sam Saffron) #15