# SSO on a WP, publish from another WP

**URL:** https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558
**Category:** WordPress
**Created:** [2015年二月23日 07:55 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558 "2015-02-23T07:55:44Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [2015年二月23日 07:55 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/1 "2015-02-23T07:55:45Z")

</div>

Hi guys. I’m having this set-up:

1. one site that manages authentification (WP1) for discourse. The forum is set to not accept other users than those that are coming from this WP1

- multiple sites (WPx) are trying to post their latest posts on discourse.

I get no error when i try to post, yet the posts doesn’t shows up on Discourse

This is what I get on logs:

```plaintext
Can't verify CSRF token authenticity
Discourse::InvalidAccess (Discourse::InvalidAccess)

```

Tried to regenerate api keys, but with no luck. Also i tried to make a request with [Postman](https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en) and I get the same errors on logs, but postman also shows me a 500 error (with no extra details).

Am I doing something wrong? Thanks!

(i’m on latest versions of wp, discourse, plugin, all).

---

<div class="post-metadata">

### Author: ![sigurdur](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sigurdur/32/122516_2.png) [@sigurdur](https://meta.discourse.org/u/sigurdur)
#### Post date: [2015年二月23日 16:26 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/2 "2015-02-23T16:26:26Z")

</div>

What happens when you post from the wordpress that does the authentication?

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [2015年二月23日 17:19 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/3 "2015-02-23T17:19:04Z")

</div>

Absolutely the same thing: nothing 😃

---

<div class="post-metadata">

### Author: ![sigurdur](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sigurdur/32/122516_2.png) [@sigurdur](https://meta.discourse.org/u/sigurdur)
#### Post date: [2015年二月23日 17:48 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/4 "2015-02-23T17:48:26Z")

</div>

Then you have a problem with your API communication.

1. Did you copy the correct API key to wordpress?
2. Did you configure the Discourse plugin correctly? (correct user)

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [2015年二月23日 17:54 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/5 "2015-02-23T17:54:52Z")

</div>

Actually… I may be dumb.

It seems that the API key had a space at the end. Now everything seems fine!

Thanks!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015年二月23日 23:31 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/6 "2015-02-23T23:31:14Z")

</div>

Hmm can we check for extra spaces in the API key @techapj and strip them? If this is an easy fix in an easy place let’s make it so.

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [2015年二月24日 05:25 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/7 "2015-02-24T05:25:23Z")

</div>

I’ll probably send a couple of PRs by myself, including this quick fix 😉

---

<div class="post-metadata">

### Author: ![benword](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benword/32/493782_2.png) [@benword](https://meta.discourse.org/u/benword)
#### Post date: [2015年二月25日 02:43 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/8 "2015-02-25T02:43:39Z")

</div>

Thanks for those pull reqs 👍 — all merged!

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2023年五月16日 15:05 UTC](https://meta.discourse.org/t/sso-on-a-wp-publish-from-another-wp/25558/9 "2023-05-16T15:05:34Z")

</div>


