Synchronizing Changes for SSO users

Hi here. We used the SSO feature to connect the Discourse with our own account. As we manage accounts info on our own sites, we enabled email overriding, username overriding and name overriding. However, when a user changed his info, say email, the modification won’t be on effect until the user login Discourse, and he may lose some notification emails during this period.

I’ve tried the Discourse API.Yet, it seems that the PUT method for user’s email is being prohibited. What’s more, if I uncheck the email overriding, the PUT request I send will trigger a verification email. That’s not the way I wanted, as you see we’ve already done the verification on our own SSO site, so it’s totally redundant. But I haven’t found an option to turn off that verification email.

Can someone help me here, thanks.

2 Likes

There is an endpoint for synchronizing sso you should be using that

1 Like

Thanks, it’s really helpful.

And one more question about account creation. This post How to import SSO users suggests that we can use this endpoint POST /users to import a SSO user. However, sometimes the username we use will contradict with Discourse’s restrictions, specifically our account may have “.” (Dot). Moreover, it will send welcome message as well, what’s the correct way to do this?

We don’t have any sample for this pre-staging, you would need to use the object model direct.

@techAPJ we should have a discourse api sample for this and add missing endpoints.

3 Likes

I posted about this a while ago:

https://meta.discourse.org/t/sso-overrides-email-prevents-api-from-changing-email/15259

An example for utilizing that endpoint would be helpful. :book:

The endpoint was already present, added the sample in discourse_api:

https://github.com/discourse/discourse_api/pull/84

6 Likes