Greetings, I am hoping to get some guidance. My SSO stopped working this week and I thought I fixed everything yesterday (it was working, I swear Note: I took a look at “New Users” from yesterday and today and I had new users on both days (after I fixed it), now it is broken again… ) ). Unfortunately, the updates I made are not working today.
Problem: Users can’t create new accounts and users that logout can’t log back in.
I noticed that my discourse server has 400 errors on the following routes:
403: GET : discourse-url/users/by-external/USER-ID.json?
Note: I recently found in the api docs that this route doesn’t exist? (even though it has worked), it looks like the route is: https://discourse.example.com/u/by-external/{external_id}.json
404: POST: discourse-url/admin/users/sync_sso?
The reason the ?
mark is at the end is I have an optional parameter field in a function that generates URLs, for these two routes all the data is sent in the form body or headers.
I am using the following library.
What I updated (and what I thought fixed the problem):
In all of my requests, I was sending the Api-Key
and Api-Username
via a query parameter. For the past few months, I noticed in my admin panel that I had a warning saying I was using dated headers in my request. It linked me to this post and the key details are here:
Deprecation Warning!
On April 6th, 2020 we dropped support for all non-HTTP header based authentication (excluding some rss, mail-receiver, and ics routes). This means that API requests that have anapi_key
andapi_username
in the query params or in the HTTP body of the request will soon stop working. Please see the example cURL request below for how to update your API requests to use the HTTP headers for authentication.
I updated all of my requests, now all of my requests have the Api-Key
and Api-Username
in the header and the content type is set to multipart form data.
If anyone can offer some guidance on what to look into to debug this issue I’d greatly appreciate it. I am almost 100% confident this was working at the end of my workday yesterday, I was able to log into and out of my account and I was able to create new accounts.
Please let me know if you need more information. Thanks!