SSO on a WP, publish from another WP

(Ionuț Staicu) #1

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:

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 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).

(Sigurður Guðbrandsson) #2

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

(Ionuț Staicu) #3

Absolutely the same thing: nothing :smiley:

(Sigurður Guðbrandsson) #4

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)

(Ionuț Staicu) #5

Actually… I may be dumb.

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


(Jeff Atwood) #6

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.

(Ionuț Staicu) #7

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

(Ben Word) #8

Thanks for those pull reqs :+1: — all merged!