How to know if user has SSO

AI-generated summary

In a discussion about identifying users with SSO (Single Sign-On) via the Discourse API, tiagomatosweb initially queried how to determine if a user has DiscourseConnect info while fetching users via admin/users/list/active.json. pfaffman clarified that if DiscourseConnect is in use, all users typically authenticate via it, and suggested checking the admin UI for login info or reverse-engineering the API using this guide. tiagomatosweb followed up, confirming they found the correct endpoint — /admin/users/{id}.json — which returns a single_sign_on_record field, precisely what they needed. They thanked pfaffman for the guidance.

Hi,
I am currently fetching users via API using admin/users/list/active.json
However, I would like to know if a particular user has DiscourseConnect info.

How would I approach that?

If you’re using Discourse_connect then all users are using it, right? Or do you mean oauth?

There is an admin route (and maybe a user preferences) that shows the login info. If you can find it in the ux you can How to reverse engineer the Discourse API.

Oh I was using the /u/{username}.json endpoint.
But doing the reverse engineer I realised that the correct endpoint is /admin/users/{id}.json. This endpoint return a field called “single_sign_on_record” which is what I was after.

Cheers, tks @pfaffman