API calls not working when login_required

(Tommy Mancino) #1

I am not sure if this is intended behavior or not.

I have implemented SSO, which works great. However, I am unable to make API calls when I make the forum private by checking login_required. If I uncheck it, everything works fine. I have tried it with the master API key, as well as a private API admin key for the signed in user.

I see that I am being redirected to login when trying to access the json via the api, using the discourse-api gem.

ActionView::Template::Error (757: unexpected token at ‘You are being redirected.’):

Is this working as intended? Thanks…

Note: I found this discussion and will look at the source update API to handle CSRF token by spaghetticode · Pull Request #20 · discourse/discourse_api · GitHub

Resolution: This was being caused by the discourse_api gem being out of date. I updated and submitted pull request.

(Sam Saffron) #2

Thanks for the fix. cheers

(Sam Saffron) #3