# SSO credentials validity / forced logout

**URL:** <https://meta.discourse.org/t/sso-credentials-validity-forced-logout/126874>\
**Category:** WordPress\
**Created:** [August 26, 2019, 9:31pm UTC](https://meta.discourse.org/t/sso-credentials-validity-forced-logout/126874 "2019-08-26T21:31:23Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [September 30, 2019, 4:25pm UTC](https://meta.discourse.org/t/sso-credentials-validity-forced-logout/126874/9 "2019-09-30T16:25:18Z")

</div>

> [@markwill](#):
>
> I guess my final option, potentially, is to write a plugin that will call a Discourse API to log them out when they cancel.

You can make an API request to `/admin/users/<discourse_user_id>/log_out`. The [WP Discourse](https://github.com/discourse/wp-discourse) plugin uses this route to sync logging out of WordPress with Discourse. You could probably copy most of the code from this function: [wp-discourse/lib/sso-provider/discourse-sso.php at main · discourse/wp-discourse · GitHub](https://github.com/discourse/wp-discourse/blob/master/lib/sso-provider/discourse-sso.php#L205).

---

_[View the full topic](https://meta.discourse.org/t/sso-credentials-validity-forced-logout/126874)._
