SSO on a WP, publish from another WP

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

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

Absolutely the same thing: nothing :smiley:

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)

Actually… I may be dumb.

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

Thanks!

1 Like

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.

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

3 Likes

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

4 Likes