# SSO integration & external profile sync help

**URL:** https://meta.discourse.org/t/sso-integration-external-profile-sync-help/62457
**Category:** Support
**Created:** [May 10, 2017, 7:03pm UTC](https://meta.discourse.org/t/sso-integration-external-profile-sync-help/62457 "2017-05-10T19:03:46Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [May 10, 2017, 8:36pm UTC](https://meta.discourse.org/t/sso-integration-external-profile-sync-help/62457/4 "2017-05-10T20:36:12Z")

</div>

> [@Brock\_Busby](#):
>
> Is there a way to have these syncs happen in the backend? When a user logs in, and while the sync happens, we display a message to the user. This can be problematic since it can take longer than we’d like and gives opportunity to interrupt the sync with a refresh or closing the tab.

### 2.

> [@Brock\_Busby](#):
>
> gives opportunity to interrupt the sync with a refresh or closing the tab

Just get your auth / profile editing external site to sync to Discourse server-side as soon as a change occurs, it’s a single HTTP request. No need for messages etc. You should not be doing this client-side - i.e. no worries about closing a tab.

For security reasons I would avoid going beyond 60 days without requiring re-auth if the user hasn’t interacted with Discourse.

### 3.

> [@Brock\_Busby](#):
>
> Discourse auto log out: by default, Discourse logs users out after 1440 hours.

If users do use your external site just have your page contain insert a hidden IFRAME / EMBED of the Discourse site to the URL `/session/sso`…  
Only add this hidden IFRAME when the user hasn’t been authenticated recently (so it doesn’t slow down every page load) - probably just when they initially login.

This will keep the Discourse session alive. (EDIT: Note this will also log them into Discourse if they aren’t already)

You can look to the Discourse WordPress plugin I believe it contains something like this.

---

_[View the full topic](https://meta.discourse.org/t/sso-integration-external-profile-sync-help/62457)._
