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

**URL:** <https://meta.discourse.org/t/users-by-external-route-doesnt-support-external-id-values-with-in-them/24730>\
**Category:** Bug\
**Created:** [February 2, 2015, 5:17pm UTC](https://meta.discourse.org/t/users-by-external-route-doesnt-support-external-id-values-with-in-them/24730 "2015-02-02T17:17:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcfox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rcfox/32/115486_2.png) [@rcfox](https://meta.discourse.org/u/rcfox)\
**Post date:** [February 2, 2015, 5:17pm UTC](https://meta.discourse.org/t/users-by-external-route-doesnt-support-external-id-values-with-in-them/24730/1 "2015-02-02T17:17:28Z")

</div>

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](http://stackoverflow.com/questions/6719797/need-a-rails-route-with-a-possible-period-in-the-id-but-also-retain-the-option). Could you fix this?

Thanks!

---

<div class="post-metadata">

**Author:** ![rcfox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rcfox/32/115486_2.png) [@rcfox](https://meta.discourse.org/u/rcfox)\
**Post date:** [February 2, 2015, 6:05pm UTC](https://meta.discourse.org/t/users-by-external-route-doesnt-support-external-id-values-with-in-them/24730/2 "2015-02-02T18:05:46Z")

</div>

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](https://github.com/discourse/discourse/pull/3163)

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.

---

<div class="post-metadata">

**Author:** ![rcfox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rcfox/32/115486_2.png) [@rcfox](https://meta.discourse.org/u/rcfox)\
**Post date:** [February 17, 2015, 4:04pm UTC](https://meta.discourse.org/t/users-by-external-route-doesnt-support-external-id-values-with-in-them/24730/3 "2015-02-17T16:04:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)\
**Post date:** [February 17, 2015, 4:10pm UTC](https://meta.discourse.org/t/users-by-external-route-doesnt-support-external-id-values-with-in-them/24730/4 "2015-02-17T16:10:34Z")

</div>

See also this for some back discussion:

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

---

<div class="post-metadata">

**Author:** ![martinduparc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martinduparc/32/115526_2.png) [@martinduparc](https://meta.discourse.org/u/martinduparc)\
**Post date:** [October 26, 2016, 6:19pm UTC](https://meta.discourse.org/t/users-by-external-route-doesnt-support-external-id-values-with-in-them/24730/5 "2016-10-26T18:19:43Z")

</div>

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

I am having problems using the [by-external](https://github.com/discourse/discourse/blob/master/config/routes.rb#L364) route.

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

cc @mbeale

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [November 10, 2020, 2:33pm UTC](https://meta.discourse.org/t/users-by-external-route-doesnt-support-external-id-values-with-in-them/24730/6 "2020-11-10T14:33:05Z")

</div>

dots in external\_ids are now supported
