iamntz  
                
                  
                    Fevereiro 23, 2015,  7:55am
                   
                  1 
               
             
            
              Hi guys. I’m having this set-up:
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).
             
            
              
            
           
          
            
              
                sigurdur  
              
                  
                    Fevereiro 23, 2015,  4:26pm
                   
                  2 
               
             
            
              What happens when you post from the wordpress that does the authentication?
             
            
              
            
           
          
            
              
                iamntz  
              
                  
                    Fevereiro 23, 2015,  5:19pm
                   
                  3 
               
             
            
              Absolutely the same thing: nothing 
             
            
              
            
           
          
            
              
                sigurdur  
              
                  
                    Fevereiro 23, 2015,  5:48pm
                   
                  4 
               
             
            
              Then you have a problem with your API communication.
Did you copy the correct API key to wordpress? 
Did you configure the Discourse plugin correctly? (correct user) 
 
             
            
              
            
           
          
            
              
                iamntz  
              
                  
                    Fevereiro 23, 2015,  5:54pm
                   
                  5 
               
             
            
              Actually… I may be dumb.
It seems that the API key had a space at the end. Now everything seems fine!
Thanks!
             
            
              1 curtida 
            
            
           
          
            
            
              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.
             
            
              
            
           
          
            
              
                iamntz  
              
                  
                    Fevereiro 24, 2015,  5:25am
                   
                  7 
               
             
            
              I’ll probably send a couple of PRs by myself, including this quick fix 
             
            
              3 curtidas 
            
            
           
          
            
              
                benword  
              
                  
                    Fevereiro 25, 2015,  2:43am
                   
                  8 
               
             
            
              Thanks for those pull reqs 
             
            
              4 curtidas