And to get the inverse (ie obtain the external_id given a user_id) you can either:
-
Use the Discourse Ruby API and call the method: user_sso(user_id)
-
Send an authenticated get request to:
https://discourse.example.com/admin/users/{id}.json
and look for hash key [“single_sign_on_record”][“external_id”]
Note that single_sign_on_record (and external_id) is NOT returned by a call to:
https://discourse.example.com/users/{username}.json