/users/by-external route doesn't support external_id values with "." in them

AI-generated summary

Issue with /users/by-external route: The /users/by-external route does not support external_id values containing periods (.). This is a known issue in Rails, as discussed in this Stack Overflow thread.

Pull Request and Discussion: A pull request was submitted to address this issue, but the progress is uncertain. A related discussion about usernames with periods is also referenced.

Route Usage Clarification: The correct URL for the /users/by-external route is mydiscoursesite.com/users/by-external/1.json, but it’s unclear if mydiscoursesite.com/users/by-external/1 should work, where 1 is the external id from the SSO user table.

I noticed that the API includes a by-external route, which seems to allow you to get user data by the SSO external id, which is great. Unfortunately, it doesn’t seem to work with external_ids that have periods in them.

It looks like this is a common issue with Rails. Could you fix this?

Thanks!

1 Curtiu

I made a pull request: Allow periods in the external_id value used in the /users/by-external route. by rcfox · Pull Request #3163 · discourse/discourse · GitHub

I barely know what I’m doing with Ruby and next to no idea about Rails, so I’m not sure if there’s a better way to do this.

It’s been over two weeks since I reported this bug… It’d be nice to hear if this is something you plan to fix, or not.

Thanks.

See also this for some back discussion:

https://meta.discourse.org/t/usernames-with-periods-are-changed-to-underscore/17168?u=downey

UPDATED:
Here is the correct url: mydiscoursesite.com/users/by-external/1.json

I am having problems using the by-external route.

Should the following url work?
mydiscoursesite.com/users/by-external/1 (1 being the external id from the SSO user table)

cc @mbeale

1 Curtiu

Pontos em external_ids agora são suportados